-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support setting file accessed/modified timestamps #98246
Conversation
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
r? @m-ou-se (rust-highfive has picked a reviewer for you, use r? to override) |
af110f4
to
8f3fc2e
Compare
@bors r+ |
📌 Commit 8f3fc2e5de8d702b93bb5cf1432630ab721f78d8 has been approved by |
@bors r- Actually, |
@bors r+ |
📌 Commit 585767d has been approved by |
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.
Failed in rollup: #98347 (comment) |
This comment has been minimized.
This comment has been minimized.
@bors r=m-ou-se |
⌛ Testing commit f8061dd with merge eb5c3654b416912da280a0808ac36499e50d3bfe... |
💥 Test timed out |
@bors retry |
☀️ Test successful - checks-actions |
Finished benchmarking commit (1f5d8d4): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
…-98246, r=joshtriplett kmc-solid: Add a stub implementation of rust-lang#98246 (`File::set_times`) Fixes the build failure of the [`*-kmc-solid_*`](https://doc.rust-lang.org/nightly/rustc/platform-support/kmc-solid.html) Tier 3 targets after rust-lang#98246. This target does not support setting a modification time and access time separately, hence stubbing out the implementation.
Rollup of 6 pull requests Successful merges: - rust-lang#99835 (Suggest adding/removing `ref` for binding patterns) - rust-lang#100155 (Use `node_type_opt` to skip over generics that were not expected) - rust-lang#100157 (rustdoc: use `collect()` instead of repeatedly pushing) - rust-lang#100158 (kmc-solid: Add a stub implementation of rust-lang#98246 (`File::set_times`)) - rust-lang#100166 (Remove more Clean trait implementations) - rust-lang#100168 (Improve diagnostics for `const a: = expr;`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fix HorizonOS regression in FileTimes The changes in rust-lang#98246 caused a regression for multiple Newlib-based systems. This is just a fix including HorizonOS to the list of targets which require a workaround. `@AzureMarker` `@ian-h-chamberlain` r? `@nagisa`
Fix HorizonOS regression in FileTimes The changes in rust-lang#98246 caused a regression for multiple Newlib-based systems. This is just a fix including HorizonOS to the list of targets which require a workaround. `@AzureMarker` `@ian-h-chamberlain` r? `@nagisa`
Fix HorizonOS regression in FileTimes The changes in rust-lang#98246 caused a regression for multiple Newlib-based systems. This is just a fix including HorizonOS to the list of targets which require a workaround. ``@AzureMarker`` ``@ian-h-chamberlain`` r? ``@nagisa``
Add
struct FileTimes
to contain the relevant file timestamps, sincemost 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 aFile
.Implement the
sys
backends for UNIX, macOS (which needs to fall backto
futimes
before macOS 10.13 because it lacksfutimens
), Windows,and WASI.