Function nc::mkdir

source ·
pub unsafe fn mkdir<P: AsRef<Path>>(
    filename: P,
    mode: mode_t
) -> Result<(), Errno>
Expand description

Create a directory.

§Example

let path = "/tmp/nc-mkdir";
let ret = unsafe { nc::mkdir(path, 0o755) };
assert!(ret.is_ok());
let ret = unsafe { nc::unlinkat(nc::AT_FDCWD, path, nc::AT_REMOVEDIR) };
assert!(ret.is_ok());