bugfindutils - Bugs: bug #30526, No match with a file with modified...

 
 

bug #30526: No match with a file with modified n days ago in "-mtime"

Submitted by:  Norihirio Tanaka <noritnk>
Submitted on:  Fri 23 Jul 2010 02:49:38 AM UTC  
 
Category: NoneSeverity: 5 - Blocker
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
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.

 

Thu 06 Oct 2011 10:55:21 AM UTC, comment #4:

When you run `find' after run `touch', few nsecs has passed.
You need to apply following patch to ignore it, before test the problem.

--
static double ts_difference(struct timespec ts1,
struct timespec ts2)
{
- double d = difftime(ts1.tv_sec, ts2.tv_sec)
- + (1.0e-9 * (ts1.tv_nsec - ts2.tv_nsec));
+ double d = difftime(ts1.tv_sec, ts2.tv_sec);
+ printf ("** DEBUG ** d = %f\n", d);
return d;
}
--

$ touch -d '1 day ago' recent ; ./find recent -mtime 0

    • DEBUG ** d = 0.000000

$ touch -d '1 day ago' recent ; ./find recent -mtime -0

    • DEBUG ** d = -86399.000000

$ touch -d '1 day ago' recent ; ./find recent -mtime +0

    • DEBUG ** d = 0.000000

$ touch -d '1 day ago' recent ; ./find recent -mtime 1

    • DEBUG ** d = 86400.000000

recent

$ touch -d '1 day ago' recent ; ./find recent -mtime -1

    • DEBUG ** d = 1.000000

recent

$ touch -d '1 day ago' recent ; ./find recent -mtime +1

    • DEBUG ** d = 86400.000000
Norihirio Tanaka <noritnk>
Mon 22 Aug 2011 01:05:07 AM UTC, comment #3:

I don't think I am able to reproduce the first part of your bug report. Are you able to create a shell script which demonstrates your problem?

$ touch -d '1 day ago' recent ; find recent -mtime 0
$ touch -d '1 day ago' recent ; find recent -mtime -0
$ touch -d '1 day ago' recent ; find recent -mtime +0
recent
$ touch -d '1 day ago' recent ; find recent -mtime 1
recent
$ touch -d '1 day ago' recent ; find recent -mtime +1

James Youngman <jay>
Project Administrator
Sat 20 Aug 2011 10:07:58 AM UTC, comment #2:

I think this bug should block release of the next stable findutils rlease (i.e. 4.6 or whatever).

James Youngman <jay>
Project Administrator
Fri 23 Jul 2010 07:49:10 AM UTC, comment #1:

other case:

$ find file -mtime 1
file
$ find file -mtime +1
$ find file -mtime -1
file

I expect as following.

$ find file -mtime 1
file
$ find file -mtime +1
$ find file -mtime -1

Norihirio Tanaka <noritnk>
Fri 23 Jul 2010 02:49:38 AM UTC, original submission:

Hi,

No match with a file modified just n days ago in "-mtime".

In this case:

now : Jul 23 2010 11:36:00 000000000
file (mtime) : Jul 22 2010 11:36:00 000000000

$ find file -mtime 0
$ find file -mtime +0
$ find file -mtime -0

I expect as following.

$ find file -mtime 0
$ find file -mtime +0
file
$ find file -mtime -0

$ ./find --version
find (GNU findutils) 4.4.2
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Eric B. Decker, James Youngman, and Kevin Dalley.
Built using GNU gnulib version e5573b1bad88bfabcda181b9e0125fb0c52b7d3b
Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS() CBO(level=0)

Norihirio Tanaka <noritnk>

 

(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 noritnk (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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 01 May 2012 08:19:33 PM UTCjayStatusWorks For Me=>None
    Mon 22 Aug 2011 01:05:07 AM UTCjayStatusNone=>Works For Me
    Sat 20 Aug 2011 10:07:58 AM UTCjaySeverity3 - Normal=>5 - Blocker

    Back to the top


    Powered by Savane 3.1-cleanup