[][src]Function fsio::directory::create

pub fn create<T: AsPath + ?Sized>(path: &T) -> Result<(), FsIOError>

Creates the directory (and if needed the parent directories) for the provided path.

Arguments

  • path - The directory path

Example

extern crate fsio;

use crate::fsio::directory;
use std::path::Path;

fn main() {
    let result = directory::create("./target/__test/directory_test/dir1/dir2");
    assert!(result.is_ok());

    let path = Path::new("./target/__test/directory_test/dir1/dir2");
    assert!(path.exists());
}