This is an archive of the discontinued LLVM Phabricator instance.

[Support] NFC: Allow modifying access/modification times independently in sys::fs::setLastModificationAndAccessTime.
ClosedPublic

Authored by rupprecht on Aug 9 2018, 10:43 AM.

Details

Summary

Add an overload to sys::fs::setLastModificationAndAccessTime that allows setting last access and modification times separately. This will allow tools to use this API when they want to preserve both the access and modification times from an input file, which may be different.

Also note that both the POSIX (futimens/futimes) and Windows (SetFileTime) APIs take the two timestamps in the order of (1) access (2) modification time, so this renames the method to "setLastAccessAndModificationTime" to make it clear which timestamp is which.

For existing callers, the 1-arg overload just sets both timestamps to the same thing.

Diff Detail

Event Timeline

rupprecht created this revision.Aug 9 2018, 10:43 AM
zturner accepted this revision.Aug 13 2018, 2:37 PM
This revision is now accepted and ready to land.Aug 13 2018, 2:37 PM
This revision was automatically updated to reflect the committed changes.