Function rfm::extract [−][src]
pub fn extract(from: &Vec<&PathBuf>, to: &PathBuf) -> Result<()>
Expand description
Extracts all files from the directory, including nested files.
from
- takes a list of paths of where you want to extract files from.
to
- destination path.
Errors
This function will return an error in the following situations, but is not limited to just these case:
- Param
from
contains file or directory does not exist. - Param
from
contains file or directory with invalid name. - The current process does not have the permission to access to input params.
Example
ⓘ
extern crate rfm; use rfm::extract; let dir = std::path::Path::new("./dir").to_path_buf(); let dir_2 = std::path::Path::new("./dir_2").to_path_buf(); let dirs: Vec<&std::path::PathBuf> = vec![&dir, &dir_2]; let to = std::path::Path::new("./tests/expected_files").to_path_buf(); extract(&dirs, &to)?;