[−][src]Function rfm::clean
pub fn clean(paths: &Vec<&PathBuf>) -> Result<()>
Clears the directory/directories of all child files and directories on the
passed path.
paths
- takes a list of paths of what you want to clean.
Errors
This function will return an error in the following situations, but is not limited to just these case:
- Param
paths
contains file or directory does not exist. - Param
paths
contains file or directory with invalid name. - The current process does not have the permission to access to input params.
Example
ⓘThis example is not tested
extern crate rfm; use rfm::clean; let dir_1 = std::path::Path::new("./dir1").to_path_buf(); let dir_2 = std::path::Path::new("./dir2").to_path_buf(); let dirs: Vec<&std::path::PathBuf> = vec![&dir_1, &dir_2]; clean(&dirs)?;