Function futimesat
pub unsafe fn futimesat<P>(
dirfd: i32,
filename: P,
times: &[timeval_t; 2],
) -> Result<(), i32> ⓘ
Available on crate feature
dep_nc
only.Expand description
Change timestamp of a file relative to a directory file discriptor.
§Examples
let path = "/tmp/nc-futimesat";
let fd = unsafe { nc::openat(nc::AT_FDCWD, path, nc::O_WRONLY | nc::O_CREAT, 0o644) };
assert!(fd.is_ok());
let fd = fd.unwrap();
let ret = unsafe { nc::close(fd) };
assert!(ret.is_ok());
let times = [
nc::timeval_t {
tv_sec: 100,
tv_usec: 0,
},
nc::timeval_t {
tv_sec: 10,
tv_usec: 0,
},
];
let ret = unsafe { nc::futimesat(nc::AT_FDCWD, path, ×) };
assert!(ret.is_ok());
let ret = unsafe { nc::unlinkat(nc::AT_FDCWD, path, 0) };
assert!(ret.is_ok());