bugfindutils - Bugs: bug #23065, -daystart measures from start of...

 
 

bug #23065: -daystart measures from start of tomorrow - manual incorrect

Submitter:  Julien Levi <jlevi>
Submitted:  Sat 26 Apr 2008 12:25:15 PM UTC
   
 
Category:  find Severity:  5 - Blocker
Priority:  5 - Normal Item Group:  None
Status:  None Privacy:  Public
Assigned to:  jay Originator Name: 
Open/Closed:  Open Release:  None
Fixed Release:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Sun 21 Aug 2011 09:38:21 PM UTC, comment #3: 

Since this bug has been with us in the code for a long, long time, I'm reluctant to just fix it in a point release, because this will doubtless change the effect of a number of user scripts.

However, while the code doesn't agree with the documentation, updating the documentation seems wrong too:

1. having -daystart documenting as setting the origin at the beginning of tomorrow seems deeply unintuitive.

2. it looks to me like the current code doesn't align the origin with midnight around the points when the clocks change, either, though I have not verified this in testing.

There's no obvious answer which fixes the bug but won't break scripts.   However, here's one idea for a transition.   Comments appreciated.

1. Modify the existing -daystart so that it takes an optional argument.   The argument can be "tomorrow-ish" or "today".   "-daystart tomorrow-ish" has the same meaning as -daystart does now.    Document the precise effect of tomorrow-ish.   ("ish" because of the problem with short/long days).  The argument "today" makes find do what the documentation says it should.   If no argument is used, a warning message is issued and "tomorrow-ish" is assumed.

2. Either deprecate "-daystart" without a following option, or warn that its meaning will change.

Comments appreciated.

James Youngman <jay>
Group administrator
Sun 21 Aug 2011 02:04:35 PM UTC, comment #2: 

It looks like this bug (specifically, a difference between the -daystart documentation and its implementation) dates back from before the start of the current source tree in 1996.   It also appears to be present in version 3.8 (from 1993).

James Youngman <jay>
Group administrator
Sat 20 Aug 2011 10:08:37 AM UTC, comment #1: 

Clarifying this should block release of the next stable findutils release (i.e. 4.6 or whatever).

James Youngman <jay>
Group administrator
Sat 26 Apr 2008 12:25:15 PM UTC, original submission:  

The find manual states that the "-daystart" option causes find to measure relative times from the start of "today" i.e if today is 1st January 2008 it would measure from "00:00:00 01/01/2008"

In actual fact, with the -daystart option find measures from the start of tomorrow i.e if today is 1st January 2008, it measures from "00:00:00 02/01/2008"

Example

Create a file with time 10 minutes from end of today:

$ touch -d 'today 23:50' testfile

Find files more than 5 minutes older than "daystart":

$ find ./testfile -daystart -mmin +5
./testfile

According to the manual the above command should not find "testfile". The manual needs updating with the correct behaviour of this command.

Julien Levi <jlevi>

 

Attached Files

This item currently has no attached files.

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by jay (Posted a comment)
  • -email is unavailable- added by jlevi (Submitted the item)
  •  

    Votes

    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.

     

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

    History

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-08-21 jay Assigned toNone jay
    2011-08-20 jay Severity3 - Normal 5 - Blocker

    Back to the top

    Powered by Savane 3.16-a7ba.
    Corresponding source code