From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Tue, 1 Oct 2013 07:53:58 -0400 To: 9fans@9fans.net Message-ID: <8b7ddf05bd2993bf15286a6ad2d4f780@kw.quanstro.net> In-Reply-To: <7963B664-4127-47A3-B8CF-88FA70C52AA6@ar.aichi-u.ac.jp> References: <7963B664-4127-47A3-B8CF-88FA70C52AA6@ar.aichi-u.ac.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] bug? test f -older t Topicbox-Message-UUID: 82da9a4a-ead8-11e9-9d60-3106f5b1d025 On Tue Oct 1 07:35:11 EDT 2013, arisawa@ar.aichi-u.ac.jp wrote: > Hello, >=20 > Am I missing something? > It seems logic is inverted to me. >=20 > Kenji Arisawa >=20 > 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=20 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 =E2=89=A4. 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 wron= g, 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 =3D dir->mtime + n < time(0); > free(dir); > return r; i have the following, perhaps from your suggestion: if(rel) n =3D time(0) - n; if(n < 0) r =3D 0; else r =3D dir->mtime < n; - erik