tauri_sys::fs

Function create_dir

source
pub async fn create_dir(
    dir: &Path,
    base_dir: BaseDirectory,
) -> Result<(), Error>
Expand description

Creates a directory. If one of the path’s parent components doesn’t exist the promise will be rejected.

§Example

use tauri_sys::fs;

fs::create_dir(dir, BaseDirectory::Download).expect("could not create directory");

Requires allowlist > fs > createDir to be enabled.