find(1) question about mtime

Israel Pinkas ~ pinkas at hobbit.intel.com
Wed Apr 5 05:57:15 AEST 1989


In article <976 at n8emr.UUCP> lwv at n8emr.UUCP (Larry W. Virden) writes:

> I am using find on both Ultrix 2.3 and SunOS 4.0.1 on a 386i.  I have
> a file whose ls -l date (documented as the modification time) is
> April 1, 1989 at 9:09 am.  On my machine, it is after 10am on April 3.
> I run find filename -mtime +1 -print.  My file's name does not appear.
> I run find filename -mtime 1 -print.  My file's name DOES appear.
>
> Note that it is more than 48 hours after the modification time.  Why does
> find insist that the mtime is only 1 day old?

Actually, in most of the United States, we lost an hour between 2 and 3 am
on April 2.  Therefore, from 9:09 am, April 1 to 10:00 am, April 3, there
was only 47:51 elapsed time.

I don't know whether this is a bug or not.  My understanding is that
"-mtime 1" means that the file was modified 1 day ago.  I assume that this
means between one and two days.  "-mtime +1" means more than one day.  To
me this means at least two days.  Thus, if the modification date were 9:09,
April 1, I would expect:

    -mtime	means
    ------	-----
     1		10:09 April 2 through 10:08 April 3
    +1		10:09 April 3 and later
    -1		before 10:09, April 2

* One could argue that the time should be 9:09.  That is, the clock time
  matters, not the elapsed time.

-Israel Pinkas
--
--------------------------------------
Disclaimer: The above are my personal opinions, and in no way represent
the opinions of Intel Corporation.  In no way should the above be taken
to be a statement of Intel.

UUCP:	{amdcad,decwrl,hplabs,oliveb,pur-ee,qantel}!intelca!mipos3!cadev4!pinkas
ARPA:	pinkas%cadev4.intel.com at relay.cs.net
CSNET:	pinkas at cadev4.intel.com



More information about the Comp.unix.questions mailing list