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

 
 

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

Submitted by:  Julien Levi <jlevi>
Submitted on:  Sat 26 Apr 2008 12:25:15 PM UTC  
 
Category: findSeverity: 5 - Blocker
Item Group: NoneStatus: None
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: Open/Closed: Open
Release: NoneFixed Release: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>

 

(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 jay (Posted a comment)
  • -unavailable- added by jlevi (Submitted the item)
  •  

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

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 21 Aug 2011 09:38:21 PM UTCjayAssigned toNone=>jay
    Sat 20 Aug 2011 10:08:37 AM UTCjaySeverity3 - Normal=>5 - Blocker

    Back to the top


    Powered by Savane 3.1-cleanup