[][src]Function rfm::mkdir

pub fn mkdir(dir_paths: &Vec<&PathBuf>) -> Result<()>

Creates a directory/directories on the passed path. Note, the function creates all missing directories if they occur in the passed parameter. dir_paths - takes a list of paths of what you want to create.

Errors

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

  • Param dir_paths contains file or directory does not exist.
  • Param dir_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::mkdir;

 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];

 mkdir(&dirs)?;