On Tue Oct  1 07:35:11 EDT 2013, aris...@ar.aichi-u.ac.jp wrote:
> Hello,
> 
> Am I missing something?
> It seems logic is inverted to me.
> 
> Kenji Arisawa
> 
> maia% ls -l
> ...
> --rw-rw-r-- M 323 arisawa arisawa         0 Sep 29 06:29 x
> --rw-rw-r-- M 323 arisawa arisawa        14 Sep 28 17:50 z
> maia% mtime x
>  1380403777 x
> maia% if(test z -older 1380403777) echo older
> maia% if(! test z -older 1380403777) echo older

i assume that there is some copy paste error here?  (the 
mtime of z is not shown.)

if not, "older" is not equivalent to "not younger than";
x is older than y means mtime(x) < mtime(y), and not ≤.

minooka; touch x
minooka; mtime x
 1380627631 x
minooka; if(test x -older 1380627631) echo older
minooka; if(test x -older 1380627632) echo older
older

> I have forgotten that I took up this bug in Jun this year.
> Already fixed in distribution?

the distribution's executable is really broken.  even if the sign is wrong,
one of the following must be true:

minooka; 9fs sources
minooka; if(/n/sources/plan9/386/bin/test x -older 1380627630)echo older
minooka; if(/n/sources/plan9/386/bin/test x -older 1380627631)echo older
minooka; if(/n/sources/plan9/386/bin/test x -older 1380627632)echo older

>       r = dir->mtime + n < time(0);
>       free(dir);
>       return r;

i have the following, perhaps from your suggestion:

        if(rel)
                n = time(0) - n;
        if(n < 0)
                r =  0;
        else
                r = dir->mtime < n;

- erik

Reply via email to