Bug 15803 – std.file should support sub-second file time precision on POSIX

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-03-16T18:19:00Z
Last change time
2016-04-22T23:20:45Z
Keywords
pull
Assigned to
dlang-bugzilla
Creator
dlang-bugzilla

Comments

Comment #0 by dlang-bugzilla — 2016-03-16T18:19:05Z
Modern POSIX-like operating systems and filesystems expose sub-second file time resolution through various extensions. Currently, std.file does not utilize them, only using the time_t values which offer precision with only second granularity. Since SysTime (the format used by std.file for file times) supports hectananosecond precision, std.file needs to detect the presence of these extensions (as declared in Druntime), and provide seamless interoperability through them to achieve full timestamp precision for files.
Comment #1 by dlang-bugzilla — 2016-03-16T18:26:15Z
Setting timestamps is already done with full resolution (toTimeVal + utimes).
Comment #2 by dlang-bugzilla — 2016-03-16T19:50:55Z
Comment #3 by dlang-bugzilla — 2016-03-16T21:17:26Z
(In reply to Vladimir Panteleev from comment #1) > Setting timestamps is already done with full resolution (toTimeVal + utimes). Actually, utimes does not offer nanosecond precision. Instead, utimensat should be used when available.
Comment #4 by github-bugzilla — 2016-04-22T23:20:45Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/c3f0469b2bc341ae7068529d2bad68b97da07306 fix Issue 15803 - std.file should support sub-second file time precision on POSIX https://github.com/dlang/phobos/commit/29b0c559f77c3e7379781df8d7fd2fb023908843 Merge pull request #4089 from CyberShadow/pull-20160316-181610-std-file-subsecond fix Issue 15803 - std.file should support sub-second file time precision on POSIX