Function fs_extra::dir::create

source ·
pub fn create<P>(path: P, erase: bool) -> Result<()>where
    P: AsRef<Path>,
Expand description

Creates a new, empty directory at the provided path.

This function takes to arguments:

  • path - Path to new directory.

  • erase - If set true and folder exist, then folder will be erased.

#Errors

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

  • User lacks permissions to create directory at path.

  • path already exists if erase set false.

#Examples

extern crate fs_extra;
use fs_extra::dir::create;

create("dir", false); // create directory