Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug in C02cont.ztst's -N test



2016/05/10 01:21, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:

> Do we need to "sleep 2" before touching $newnewnew, though?  Or could
> that part stay in the "elif"?

On a system where the nanosecond timestamps are not supported
(for example Mac OS X with the default file system HFS+),
in order for the test '$newnewnew -nt $zlnfs' to succeed,
the mtime's of the two files should have at least 1 second
difference. If the sleep is left in the 'elif' block,
then the test (for -nt) fails on OS X.

I tried with 'sleep 1' before 'touch $newnewnew' and it seems to
work. There are some tests between 'touch $zlnfs' (near the
top of the script) and the 'touch $newnewnew', so 'sleep 1' would
be enough even if there is some inaccuracy in sleep period.

Or it may be better to sleep 2 second just in case ...
Why does the original code sleeps 2 sec (instead of 1 sec).



Messages sorted by: Reverse Date, Date, Thread, Author