From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) From: arisawa In-Reply-To: <8b7ddf05bd2993bf15286a6ad2d4f780@kw.quanstro.net> Date: Tue, 1 Oct 2013 22:10:52 +0900 Content-Transfer-Encoding: quoted-printable Message-Id: <700EAA3F-DC0E-410A-A86C-E8F5D4A26DE1@ar.aichi-u.ac.jp> References: <7963B664-4127-47A3-B8CF-88FA70C52AA6@ar.aichi-u.ac.jp> <8b7ddf05bd2993bf15286a6ad2d4f780@kw.quanstro.net> To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Subject: Re: [9fans] bug? test f -older t Topicbox-Message-UUID: 82e037fc-ead8-11e9-9d60-3106f5b1d025 I looked the latest 9front source and found test.c have been already = fixed. thank you. On 2013/10/01, at 20:53, erik quanstrom wrote: > 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 >=20 > i assume that there is some copy paste error here? (the=20 > mtime of z is not shown.) >=20 > 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. >=20 > 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 >=20 >> I have forgotten that I took up this bug in Jun this year. >> Already fixed in distribution? >=20 > the distribution's executable is really broken. even if the sign is = wrong, > one of the following must be true: >=20 > 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 >=20 >> r =3D dir->mtime + n < time(0); >> free(dir); >> return r; >=20 > i have the following, perhaps from your suggestion: >=20 > if(rel) > n =3D time(0) - n; > if(n < 0) > r =3D 0; > else > r =3D dir->mtime < n; >=20 > - erik >=20