devela::_dep::nc::call

Function mkdirat

pub unsafe fn mkdirat<P>(dirfd: i32, filename: P, mode: u32) -> Result<(), i32> 
where P: AsRef<Path>,
Available on crate feature dep_nc only.
Expand description

Create a directory.

§Examples

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