`touch` doesn't fill in nanoseconds for already-existing files

Originator:thakis
Number:rdar://FB8960652 Date Originated:
Status: Resolved:
Product: Product Version:
Classification: Reproducible:
 
% rm -f myfile
% touch myfile
% stat -f %Fm myfile
1609695671.787918115
% touch myfile
% stat -f %Fm myfile
1609695678.550313000

The 2nd `touch` (or any `touch` on files/directories that already exist) always sets nanoseconds (the last 3 digits in `stat -f %Fm` output) to 000.

Updating the mtime with e.g. `python -c 'open("myfile", "w")'` sets the nanoseconds field correctly.

Comments

I noticed this too

Thanks, I thought it was just some inherent limitation but your python comment proves otherwise

Now if only we can get a tool to list and copy xattrs on iOS

By Syclone0044 at Feb. 16, 2021, 9:29 a.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!