Function futimens

fn futimens<Fd: std::os::fd::AsFd>(fd: Fd, atime: &TimeSpec, mtime: &TimeSpec) -> Result<()>

Change the access and modification times of the file specified by a file descriptor.

If you want to set the timestamp to now, use TimeSpec::UTIME_NOW. Use TimeSpec::UTIME_OMIT if you don't want to change it.

References

futimens(2).