create_dir in async_std::fs - Rust (original) (raw)

Function create_dir

Source

pub async fn create_dir<P: AsRef<Path>>(path: P) -> Result<()>

Expand description

Creates a new directory.

Note that this function will only create the final directory in path. If you want to create all of its missing parent directories too, use the create_dir_all function instead.

This function is an async version of std::fs::create_dir.

§Errors

An error will be returned in the following situations:

§Examples

use async_std::fs;

fs::create_dir("./some/directory").await?;