[][src]Function async_std::fs::create_dir

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

Creates a new, empty directory.

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

Errors

An error will be returned in the following situations (not an exhaustive list):

  • path already exists.
  • A parent of the given path does not exist.
  • The current process lacks permissions to create directory at path.

Examples

use async_std::fs;

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