[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Inaccurate modification date testing
From: |
Chet Ramey |
Subject: |
Re: Inaccurate modification date testing |
Date: |
Wed, 14 Aug 2013 20:41:35 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 |
On 8/14/13 4:41 PM, Jacek Krüger wrote:
> According to the manual of bash
> file1 -nt file2
> True if file1 is newer (according to modification date) than file2, or if
> file1 exists and file2 does not
>
> Bash is innacurate when testing modification dates. It ignores fractions of
> a second. Is it expected? Coreutils test does it properly.
Bash-4.3 will use struct timespec and nanosecond granularity if it's
available and in struct stat. Bash-4.2 used the traditional time_t
members.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/