Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham
	autolearn_force=no version=3.4.1
X-Biglobe-Sender: <takimoto-j@kba.biglobe.ne.jp>
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
Subject: Re: Bug in C02cont.ztst's -N test
From: "Jun T." <takimoto-j@kba.biglobe.ne.jp>
In-Reply-To: <160509092158.ZM13643@torch.brasslantern.com>
Date: Tue, 10 May 2016 02:32:18 +0900
Content-Transfer-Encoding: 7bit
Message-Id: <9FAAD096-2119-4354-B437-4D9A0ABD2765@kba.biglobe.ne.jp>
References: <ufa1t5pl0yg.fsf@epithumia.math.uh.edu>  <160429131027.ZM22749@torch.brasslantern.com>  <ufashy4ghvy.fsf@epithumia.math.uh.edu>  <20160430004639.GA1360@tarsus.local2>  <20160430010131.GA34472@CptOrmolo.darkstar>  <20160430012828.GA3334@tarsus.local2>  <CAH+w=7b9kKY1Xr5YHFHMS4YzSptJWwU_N6p+s3R=Q=QjYYSo3w@mail.gmail.com>  <160430105547.ZM10892@torch.brasslantern.com>  <160430111131.ZM11437@torch.brasslantern.com>  <FEE16E72-B6B1-4CDE-B32D-EB111C13240C@kba.biglobe.ne.jp> <160509092158.ZM13643@torch.brasslantern.com>
To: zsh-workers@zsh.org
X-Mailer: Apple Mail (2.1878.6)
X-Biglobe-Spnum: 53258
X-Seq: zsh-workers 38449


2016/05/10 01:21, Bart Schaefer <schaefer@brasslantern.com> 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).

