bugfindutils - Bugs: bug #10927, '-ctime +1' produces output that...

 
 

bug #10927: '-ctime +1' produces output that would be correct for '-ctime +2'

Submitted by:  Andreas Metzler <ametzler>
Submitted on:  Sat 06 Nov 2004 12:09:31 PM UTC  
 
Category: findSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: Open/Closed: Closed
Release: 4.2.3Fixed Release: 4.2.9

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 05 Dec 2004 05:18:52 PM UTC, comment #4:

You can download a release of findutils in which this problem is
fixed from ftp://alpha.gnu.org/gnu/findutils.

The releases on alpha.gnu.org are for testing purposes, so please
take the time to download the release and verify that your
problem has been solved. Once the release has been sufficiently
tested, it can be uploaded to ftp.gnu.org for everybody to use it.

James Youngman <jay>
Project AdministratorIn charge of this item.
Wed 24 Nov 2004 05:57:36 PM UTC, comment #3:

I have updated the documentation (in CVS) to explain this more clearly.

James Youngman <jay>
Project AdministratorIn charge of this item.
Wed 10 Nov 2004 01:35:23 PM UTC, comment #2:

Thank you Geoff for the perfect explanation.

Jay, please close this report.
thanks, cu andreas

Andreas Metzler <ametzler>
Tue 09 Nov 2004 12:19:18 PM UTC, comment #1:

find is behaving correctly. The numbers specified for -ctime refer to whole days; fractions of days do not count. I.e. in "-ctime +1" the +1 means "the number of whole days is more than 1". For the number of whole days to be more than 1 it must be at least 2, and 2 days is 2880 minutes.

The fact that fractional days do not count is clear from the POSIX description, which says:

"-ctime n
The primary shall evaluate as true if the time of last change of file status information subtracted from the initialization time, divided by 86400 (with any remainder discarded), is n."

Thus "-ctime +1" means the result of the division by 86400 (with any remainder discarded) is more than 1.

Geoff Clare <geoffclare>
Sat 06 Nov 2004 12:09:31 PM UTC, original submission:

This is Debian Bug #278842, reported by Zed Pobre
<http://bugs.debian.org/278842>:

------------------------
Package: findutils
Version: 4.1.20-4
Severity: normal

Using -ctime +1 and -cmin +1440 should produce identical behaviour,
unless I completely misread the manpage, but this isn't actually the
case. Using -ctime +1 appears to be identical to -cmin +2880, or
greater than two days old, not one. Using -ctime +0 appears to be
identical to -cmin +1440.

erdos:/tmp> find . -maxdepth 1 -ctime +0 | wc -l
139
erdos:/tmp> find . -maxdepth 1 -ctime +1 | wc -l
97
erdos:/tmp> find . -maxdepth 1 -cmin +0 | wc -l
457
erdos:/tmp> find . -maxdepth 1 -cmin +1440 | wc -l
139
erdos:/tmp> find . -maxdepth 1 -cmin +2880 | wc -l
97
-----------------

I've tested against latest CVS code (2004-11-06T12:44:58+0100) and the behavior is identical to 4.1.20, afaict "find -Xtime +Y" is broken (X in c, m, a), it really is off by one.
thanks, cu andreas

Andreas Metzler <ametzler>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by ametzler (Debian-BTS)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 05 Dec 2004 05:18:52 PM UTCjayAssigned toNone=>jay
      Open/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.2.9
    Wed 24 Nov 2004 05:57:36 PM UTCjayStatusNone=>Fixed
    Sat 06 Nov 2004 12:09:31 PM UTCametzlerCarbon-Copy-=>Added 278842 --AT-- bugs --DOT-- debian --DOT-- org

    Back to the top


    Powered by Savane 3.1-cleanup1