Function fs_extra::copy_items[][src]

pub fn copy_items<P, Q>(from: &[P], to: Q, options: &CopyOptions) -> Result<u64> where
    P: AsRef<Path>,
    Q: AsRef<Path>, 

Copies list directories and files to another place using recursive method. This function will also copy the permission bits of the original files to destionation files (not for directories).

Errors

This function will return an error in the following situations, but is not limited to just these case:

Example

 extern crate fs_extra;
 use fs_extra::dir::copy;

 let options = dir::CopyOptions::new(); //Initialize default values for CopyOptions

 // copy dir1 and file1.txt to target/dir1 and target/file1.txt
 let mut from_paths = Vec::new();
 from_paths.push("source/dir1");
 from_paths.push("source/file.txt");
 copy_items(&from_paths, "target", &options)?;