[][src]Function trash::remove_all

pub fn remove_all<I, T>(paths: I) -> Result<(), Error> where
    I: IntoIterator<Item = T>,
    T: AsRef<Path>, 
👎 Deprecated since 1.2.0:

Use the delete_all function instead. Be careful with differences in symbolic link resolution.

Removes all files/directories specified by the collection of paths provided as an argument.

Warning: when a symbolic link is provided to this function the link target will be removed and the link will become dangling. That is if 'sl' refers to 'my-text-file' and remove("sl") is called then 'my-text-file' will be removed and 'sl' will be left dangling.

Example

#![allow(deprecated)]
use std::fs::File;
use trash::remove_all;
File::create("remove_me_1").unwrap();
File::create("remove_me_2").unwrap();
remove_all(&["remove_me_1", "remove_me_2"]).unwrap();
assert!(File::open("remove_me_1").is_err());
assert!(File::open("remove_me_2").is_err());