bugfindutils - Bugs: bug #14991, mtime documented incorrect or bug?

 
 

bug #14991: mtime documented incorrect or bug?

Submitter:  David Huffman <bigredradio>
Submitted:  Wed 16 Nov 2005 09:22:51 PM UTC
 
Category:  find Severity:  3 - Normal
Item Group:  Wrong result Status:  Invalid
Privacy:  Public Assigned to:  jay
Originator Name:  Open/Closed:  Closed
Release:  4.1.20 Fixed Release:  None
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

Sat 19 Nov 2005 10:12:29 PM UTC, comment #5: 

Not a bug.

James Youngman <jay>
Project Administrator
Thu 17 Nov 2005 07:32:19 PM UTC, comment #4: 

Why this change was made is beyond me, but I noticed that other UNIX does not work this way, however are starting to impletment this due to IEEE Std 1003.1, specs.

-mtime  n
The primary shall evaluate as true if the file modification time subtracted from the initialization time, divided by 86400 (with any remainder discarded), is n.

+n
More than n.
n
Exactly n.
-n
Less than n.

So according to this, there is no bug. Just not very intuitive. More than nothing (+0) is never a good idea in my book. Thanks for the clarification.

David Huffman <bigredradio>
Thu 17 Nov 2005 07:00:55 PM UTC, comment #3: 

-mtime +0 works.

Andreas Metzler <ametzler>
Thu 17 Nov 2005 06:43:43 PM UTC, comment #2: 

This being the case, how would perform a find for files that are 1 day old and greater. If -mtime 1 will only result in files that are 24-48 hours old. There is no +0? This still appears to be a bug.

David Huffman <bigredradio>
Thu 17 Nov 2005 06:25:30 PM UTC, comment #1: 

The documentation of the current release says this:

 -atime n   File was last accessed n*24 hours ago.  When  find
  figures  out how  many  24-hour  periods  ago the file was last
  accessed, any fractional part is ignored, so to match -atime
  +1, a file has to have been accessed at least two days ago.

(and the docs for mtime contain apointer to this paragraph)

----------------------------

-mtime +1 means "The number days since the file was modified is greater than 1".

ametzler@argenau:/tmp/foo$ for i in `seq 23 49` ; do touch -d "$i hours ago" $i ; done
ametzler@argenau:/tmp/foo$ find -mtime +1
./49
./48
ametzler@argenau:/tmp/foo$ find --version
GNU find Version 4.2.25

Andreas Metzler <ametzler>
Wed 16 Nov 2005 09:22:51 PM UTC, original submission:  

Using the command argument -mtime with gnufind (4.1.20) I have found that files that are 25 hours old will not be listed in a find with -mtime +1. From my understanding +1 would result in files older than 1 day (24 hours). mtime 1 would be exactly 24 hours old (to the second) and -1 would be files that are less than 24 hours old.  The documentation states that 1 means between 24-48 hours. Does this mean that +1 is greater than 24 hours? However it appears that +1 will only find files that are 72 hours old or older.

I have tested the find command using watch and a file was not found using -mtime +1 until 72 hours (to the second) old.

David Huffman <bigredradio>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

 

 

 

Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-11-19 jay StatusNone Invalid
    Assigned toNone jay
    Open/ClosedOpen Closed
2005-11-16 bigredradio Carbon-Copy- Added -email is unavailable-

Back to the top


Powered by Savane 3.9