Re: [coreutils] Re: [PATCH 2/2] stat: print timestamps to full resolutio
From:
Pádraig Brady
Subject:
Re: [coreutils] Re: [PATCH 2/2] stat: print timestamps to full resolution
Date:
Thu, 21 Oct 2010 15:18:12 +0100
User-agent:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
On 21/10/10 15:01, Jim Meyering wrote:
> Andreas Schwab wrote:
>> Jim Meyering <address@hidden> writes:
>>
>>> And besides, with coreutils-8.6 already released, reverting the
>>> change is no longer an option.
>>
>> Why? I'm pretty sure more breakage will pop up over time.
>
> Hmm... I see what you mean.
> Anyone using a distribution with coreutils-8.5 or older will
> think it's fine to treat $(stat -c %X) as an integer with no
> decimal or trailing fraction.
>
> Is it worthwhile to create a new format, say %...:X (and same for Y and Z)
> that expands to seconds.nanoseconds and to revert %...X to the old
> seconds-only semantics?
>
> That would make it so people could use stat's %X %Y %Z portably
> while new scripts can still get nanosecond accuracy when needed.
>
> Here's PoC code:
>
> $ for i in %X %:X %Y %:Y %Z %:Z; do src/stat -c $i .; done
> 1256665918
> 1256665918.441784225
Or use '.' rather than ':' which also has the
advantage of being backward compat with older stats,