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"

Submitter:  Norihirio Tanaka <noritnk>
Submitted:  Fri 23 Jul 2010 02:49:38 AM UTC
   
 
Category:  None Severity:  5 - Blocker
Item Group:  None Status:  None
Privacy:  Public Assigned to:  jay
Originator Name:  Open/Closed:  Open
Release:  None Fixed Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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

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

    Date Changed by Updated Field Previous Value => Replaced by
    2014-07-12 jay Assigned toNone jay
    2012-05-01 jay StatusWorks For Me None
    2011-08-22 jay StatusNone Works For Me
    2011-08-20 jay Severity3 - Normal 5 - Blocker

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code