Friday, November 30, 2018

Preview Truncates Modification Dates

Peter Steinberger:

Seems like just opening a file in macOS Preview happily resets the modification date accuracy, erasing all sub second precision. APFS offers that and we rely on it to be able to accurately detect changes.

(e.g., 1543264214.151471 gets turned into 1543264214.000000)

I wonder whether this is related to the “Ask to keep changes when closing documents” setting. I have that enabled, both because it’s familiar and because it prevents Preview from overwriting the file when I make changes that I don’t intend to save. That remains a problem because Preview has been crashy ever since the PDF rewrite, so it can overwrite your document, then crash, and then you have to remember to try to restore the correct file using the versions database.

Preview aside, APFS’s nanosecond timestamps require careful consideration for apps dealing with files that sync or are indexed. There are so many cases to consider with respect to backing up and restoring, interoperating with HFS+ volumes, etc.

See also: Taking macOS to the end of time: nanoseconds count.

Comments RSS · Twitter

Leave a Comment