Skip to content

Add subsecond resolution to 'std::io::fs::change_file_times' - #17971

Closed
alsanchez wants to merge 3 commits into
rust-lang:masterfrom
alsanchez:master
Closed

alsanchez wants to merge 3 commits into
rust-lang:masterfrom
alsanchez:master

Conversation

@alsanchez

Copy link
Copy Markdown

As described on issue #17946, the function 'change_file_times' does not update the milliseconds portion of the file timestamp when running under Unix.

As per the suggestion of @mahkoh, I have modified the function 'native::io::file::utime' so that it uses the native 'utimes' function, which does allow for millisecond granularity.

@rust-highfive

Copy link
Copy Markdown
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pcwalton (or someone else) soon.

@rust-highfive

Copy link
Copy Markdown
Contributor

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

@nodakai

nodakai commented Oct 16, 2014

Copy link
Copy Markdown
Contributor

I wonder if it makes more sense to extensively use time::Timespec in the interface of public functions. It will open the way to support sub-microsecond timestamps offered by Ext4 and NTFS, among others.
We can implement sub-microsecond timestamps with futimens(3) or SetFileTime. The problems is glibc 2.5 shipped with CentOS/RHEL 5 doesn't support futimens(3). Perhaps we can begin only with the interface change.

@alexcrichton

Copy link
Copy Markdown
Member

Closing due to inactivity (and @bors's queue is quite full!). Feel free to reopen with a rebase!

rust-bors Bot pushed a commit that referenced this pull request Nov 13, 2026
…17971)

See this for context:
#163096 (comment) .
Since rustc now has a helper that behaves identically to
`clippy_utils::std_or_core`, we can start using it in Clippy as well.

changelog: none
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 14, 2026
…ust-lang#17971)

See this for context:
rust-lang#163096 (comment) .
Since rustc now has a helper that behaves identically to
`clippy_utils::std_or_core`, we can start using it in Clippy as well.

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants