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

 
 

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

Submitter:  Andreas Metzler <ametzler>
Submitted:  Sat 06 Nov 2004 12:09:31 PM UTC
   
 
Category:  find Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  jay
Originator Name:  Open/Closed:  Closed
Release:  4.2.3 Fixed Release:  4.2.9
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group administrator
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>
Group administrator
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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2004-12-05 jay Assigned toNone jay
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.2.9
    2004-11-24 jay StatusNone Fixed
    2004-11-06 ametzler Carbon-Copy- Added 278842 --AT-- bugs --DOT-- debian --DOT-- org

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code