On 10/21/2010 08:42 AM, Pádraig Brady wrote:
Or use '.' rather than ':' which also has the
advantage of being backward compat with older stats,
To clarify, coreutils<= 8.5 output these timestamps
using an int format internally, and so ignored any specified precision.
Not quite:
$ stat -c%0.20X .
00000000001287615247
coreutils 8.6 treats these timestamps as strings and
therefore %.X will not output anything which is a pity,
but if we're considering making 8.6 "special" in it's
handling of %[WXYZ], then perhaps this is OK.
I'm still wary of special-casing precision like this; should it behave
more like printf()s %.d or %.f? What you are arguing for is that %X has
no . or subsecond digits, %.X has nine subsecond digits, but what about
%.*X? At this point, I'm thinking that %:X is nicer than %.X, to avoid
these types of confusion, and given that date(1) already supports %:z.
--
Eric Blake [email protected] +1-801-349-2682
Libvirt virtualization library http://libvirt.org