Follow-up Comment #4, bug #30526 (project findutils):
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 = %fn", 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
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?30526>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/