9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: arisawa <arisawa@ar.aichi-u.ac.jp>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] bug? test f -older t
Date: Tue,  1 Oct 2013 22:10:52 +0900	[thread overview]
Message-ID: <700EAA3F-DC0E-410A-A86C-E8F5D4A26DE1@ar.aichi-u.ac.jp> (raw)
In-Reply-To: <8b7ddf05bd2993bf15286a6ad2d4f780@kw.quanstro.net>


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 <quanstro@quanstro.net> wrote:

> On Tue Oct  1 07:35:11 EDT 2013, arisawa@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	other threads:[~2013-10-01 13:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-01 11:34 arisawa
2013-10-01 11:44 ` arisawa
2013-10-01 11:53 ` erik quanstrom
2013-10-01 13:10   ` arisawa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=700EAA3F-DC0E-410A-A86C-E8F5D4A26DE1@ar.aichi-u.ac.jp \
    --to=arisawa@ar.aichi-u.ac.jp \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).