Function nc::fchmodat [−][src]
pub fn fchmodat<P: AsRef<Path>>(
dirfd: i32,
filename: P,
mode: mode_t
) -> Result<(), Errno>
Expand description
Change permissions of a file.
let filename = "/tmp/nc-fchmodat";
let ret = nc::creat(filename, 0o644);
assert!(ret.is_ok());
let fd = ret.unwrap();
assert!(nc::close(fd).is_ok());
assert!(nc::fchmodat(nc::AT_FDCWD, filename, 0o600).is_ok());
assert!(nc::unlink(filename).is_ok());