alexcrichton / filetime

Accessing file timestamps in a platform-agnostic fashion in Rust
Apache License 2.0
122 stars 56 forks source link

Add functions for setting only mtime/atime #26

Closed drrlvn closed 5 years ago

drrlvn commented 6 years ago

Please add set_file_mtime() and set_file_atime() that set only one of the values.

In Linux this can be done by passing UTIME_OMIT as the argument that's not needed. See example in libstdc++'s implementation of std::filesystem::last_write_time(): https://github.com/gcc-mirror/gcc/blob/gcc-8_1_0-release/libstdc%2B%2B-v3/src/filesystem/std-ops.cc#L1067

alexcrichton commented 6 years ago

Sounds reasonable to me!

alexcrichton commented 5 years ago

Done in https://github.com/alexcrichton/filetime/pull/40