[−][src]Function trash::delete_all
pub fn delete_all<I, T>(paths: I) -> Result<(), Error> where
I: IntoIterator<Item = T>,
T: AsRef<Path>,
Removes all files/directories specified by the collection of paths provided as an argument.
When a symbolic link is provided to this function, the sybolic link will be removed and the link target will be kept intact.
Example
use std::fs::File; use trash::delete_all; File::create("delete_me_1").unwrap(); File::create("delete_me_2").unwrap(); delete_all(&["delete_me_1", "delete_me_2"]).unwrap(); assert!(File::open("delete_me_1").is_err()); assert!(File::open("delete_me_2").is_err());