|
From: | Eric Blake |
Subject: | Re: [coreutils] Re: [PATCH 2/2] stat: print timestamps to full resolution |
Date: | Thu, 21 Oct 2010 08:49:41 -0600 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100921 Fedora/3.1.4-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.4 |
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 address@hidden +1-801-349-2682 Libvirt virtualization library http://libvirt.org
[Prev in Thread] | Current Thread | [Next in Thread] |