|
From: | Eric Blake |
Subject: | Re: [coreutils] Re: [PATCH 2/2] stat: print timestamps to full resolution |
Date: | Thu, 21 Oct 2010 09:37:11 -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 09:33 AM, Jim Meyering wrote:
Then, to get full seconds.nanoseconds, you'd use a format like %X.%:X and if you want only milliseconds, you'd use %X.%3.3:XOops. I forgot to zero-pad. Otherwise, with< 100,000,000ns in the first case or< 100 in the 2nd, and the above would print invalid numbers. This is the right way: To get full seconds.nanoseconds, you'd use a format like %X.%0:X and if you want only milliseconds, you'd use %X.%03.3:X
Do we really want to require that users must manually 0-pad, or can we explicitly state that %:X has a minimum width of min(precision,9), and 0 padding is only needed if you want a width greater than 9.
-- Eric Blake address@hidden +1-801-349-2682 Libvirt virtualization library http://libvirt.org
[Prev in Thread] | Current Thread | [Next in Thread] |