]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #98246 - joshtriplett:times, r=m-ou-se
authorbors <bors@rust-lang.org>
Mon, 1 Aug 2022 06:44:43 +0000 (06:44 +0000)
committerbors <bors@rust-lang.org>
Mon, 1 Aug 2022 06:44:43 +0000 (06:44 +0000)
commit1f5d8d49eb6111931091f700d07518cd2b80bc18
tree82ad9931fc0f0bcb4e4cbdac234cea0c74858607
parent25bb1c13bd472b75ceebee3b8dcf4dcbc431a8be
parentf8061ddb03f6b07108b0d041742f4faf0b3d5339
Auto merge of #98246 - joshtriplett:times, r=m-ou-se

Support setting file accessed/modified timestamps

Add `struct FileTimes` to contain the relevant file timestamps, since
most platforms require setting all of them at once. (This also allows
for future platform-specific extensions such as setting creation time.)

Add `File::set_file_time` to set the timestamps for a `File`.

Implement the `sys` backends for UNIX, macOS (which needs to fall back
to `futimes` before macOS 10.13 because it lacks `futimens`), Windows,
and WASI.
library/std/src/fs.rs
library/std/src/sys/unix/fs.rs
library/std/src/sys/windows/c.rs
library/std/src/sys/windows/fs.rs