Re: [coreutils] [PATCH 2/2] stat: print timestamps to full resolution

2010-10-08 Thread Jim Meyering
Eric Blake wrote: > On 10/01/2010 04:34 PM, Eric Blake wrote: >> On 10/01/2010 09:19 AM, Eric Blake wrote: Correct - time_t need not be integral, but do we have any proof of a system using a floating-point time_t? >>> >>> I think I'm going to write a POSIX bug requesting that time_t be >>

Re: [coreutils] [PATCH 2/2] stat: print timestamps to full resolution

2010-10-08 Thread Eric Blake
On 10/01/2010 04:34 PM, Eric Blake wrote: On 10/01/2010 09:19 AM, Eric Blake wrote: Correct - time_t need not be integral, but do we have any proof of a system using a floating-point time_t? I think I'm going to write a POSIX bug requesting that time_t be tightened to integral in light of the

Re: [coreutils] [PATCH 2/2] stat: print timestamps to full resolution

2010-10-01 Thread Eric Blake
On 10/01/2010 09:19 AM, Eric Blake wrote: Correct - time_t need not be integral, but do we have any proof of a system using a floating-point time_t? I think I'm going to write a POSIX bug requesting that time_t be tightened to integral in light of the fact that subsecond support is now uniforml

Re: [coreutils] [PATCH 2/2] stat: print timestamps to full resolution

2010-10-01 Thread Eric Blake
On 10/01/2010 09:03 AM, Eric Blake wrote: time_t can be a float on weird platforms I think? If you use nstrftime, no one can complain ;-) Correct - time_t need not be integral, but do we have any proof of a system using a floating-point time_t? My understanding of POSIX is that time_t was p

Re: [coreutils] [PATCH 2/2] stat: print timestamps to full resolution

2010-10-01 Thread Jim Meyering
Eric Blake wrote: > On 10/01/2010 02:21 AM, Jim Meyering wrote: >> +static char * ATTRIBUTE_WARN_UNUSED_RESULT +epoch_time (struct timespec t) +{ + static char str[INT_STRLEN_BOUND (time_t) + sizeof ".N"]; + if (TYPE_SIGNED (time_t)) +sprintf (str, "%" PR

Re: [coreutils] [PATCH 2/2] stat: print timestamps to full resolution

2010-10-01 Thread Eric Blake
On 10/01/2010 02:21 AM, Jim Meyering wrote: +static char * ATTRIBUTE_WARN_UNUSED_RESULT +epoch_time (struct timespec t) +{ + static char str[INT_STRLEN_BOUND (time_t) + sizeof ".N"]; + if (TYPE_SIGNED (time_t)) +sprintf (str, "%" PRIdMAX ".%09lu", (intmax_t) t.tv_sec, +

Re: [coreutils] [PATCH 2/2] stat: print timestamps to full resolution

2010-10-01 Thread Jim Meyering
Pádraig Brady wrote: > On 01/10/10 00:32, Eric Blake wrote: >> * src/stat.c (epoch_time): New function. >> (print_stat): Use it for %[WXYZ]. >> * NEWS: Document this. >> * tests/touch/60-seconds: Adjust test to match. >> --- >> >> It bugs me that %x has more information than %X in 'stat --format',

Re: [coreutils] [PATCH 2/2] stat: print timestamps to full resolution

2010-09-30 Thread Pádraig Brady
On 01/10/10 00:32, Eric Blake wrote: > * src/stat.c (epoch_time): New function. > (print_stat): Use it for %[WXYZ]. > * NEWS: Document this. > * tests/touch/60-seconds: Adjust test to match. > --- > > It bugs me that %x has more information than %X in 'stat --format', > especially, since we don't

[coreutils] [PATCH 2/2] stat: print timestamps to full resolution

2010-09-30 Thread Eric Blake
* src/stat.c (epoch_time): New function. (print_stat): Use it for %[WXYZ]. * NEWS: Document this. * tests/touch/60-seconds: Adjust test to match. --- It bugs me that %x has more information than %X in 'stat --format', especially, since we don't support any format modifiers for getting at the addit