Function rbatis_core::runtime::fs::create_dir [−][src]
pub async fn create_dir<P>(path: P) -> Result<(), Error> where
P: AsRef<Path>,
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:
pathalready points to an existing file or directory.- A parent directory in
pathdoes not exist. - The current process lacks permissions to create the directory.
- Some other I/O error occurred.
Examples
use async_std::fs; fs::create_dir("./some/directory").await?;