Function nc::fchmod[][src]

pub fn fchmod(fd: i32, mode: mode_t) -> Result<(), Errno>
Expand description

Change permissions of a file.

let filename = "/tmp/nc-fchmod";
let ret = nc::creat(filename, 0o644);
assert!(ret.is_ok());
let fd = ret.unwrap();
assert!(nc::fchmod(fd, 0o600).is_ok());
assert!(nc::close(fd).is_ok());
assert!(nc::unlink(filename).is_ok());