This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: find -newer problem
- From: Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
- To: Allan WIlkins <devnull4spam at yahoo dot co dot uk>
- Cc: cygwin at cygwin dot com
- Date: Mon, 27 Jun 2005 09:33:33 -0400 (EDT)
- Subject: Re: find -newer problem
- References: <42BFE607.2070804@yahoo.co.uk>
- Reply-to: cygwin at cygwin dot com
On Mon, 27 Jun 2005, Allan WIlkins wrote:
> I must apologise if this is an already known problem but I have been
> unable to locate any reference to it in the mail archives.
>
> Executing a find using the -newer parameter returns files that appear to
> be of the same age. e.g.
>
> $ find XXX -newer YYY
> XXX
> $ ls -l XXX YYY
> -r--r--r-- 1 allanw Domain Users 10291 Jun 27 10:38 XXX
> -r--r--r-- 1 allanw Domain Users 5865 Jun 27 10:38 YYY
> $ ls -lu XXX YYY
> -r--r--r-- 1 allanw Domain Users 10291 Jun 27 00:00 XXX
> -r--r--r-- 1 allanw Domain Users 5865 Jun 27 00:00 YYY
> $ ls -lc XXX YYY
> -r--r--r-- 1 allanw Domain Users 10291 Jun 27 12:21 XXX
> -r--r--r-- 1 allanw Domain Users 5865 Jun 27 12:21 YYY
>
> However:
> $ touch AAA BBB
> $ find AAA -newer BBB
> $ ls -l AAA BBB
> -rw-r--r-- 1 allanw Domain Users 0 Jun 27 12:11 AAA
> -rw-r--r-- 1 allanw Domain Users 0 Jun 27 12:11 BBB
> $ ls -lc AAA BBB
> -rw-r--r-- 1 allanw Domain Users 0 Jun 27 12:11 AAA
> -rw-r--r-- 1 allanw Domain Users 0 Jun 27 12:11 BBB
> $ ls -lu AAA BBB
> -rw-r--r-- 1 allanw Domain Users 0 Jun 27 00:00 AAA
> -rw-r--r-- 1 allanw Domain Users 0 Jun 27 00:00 BBB
> So if the files are created using touch the find does not return anything.
>
> I understand that ls -l displays the last modification time. Is the find
> using the same date?
find *is* using the same date, but you may be running into filesystem
granularity issues. FAT, for example, stores dates with the granularity
of 2 seconds. You may also want to try "test AAA -nt BBB" and "test BBB
-nt AAA", to see whether you get results that are consistent with "find".
> Thanks in advance
> Al
>
> The output of a cygcheck -s -v -r > cygcheck.out follows
> ====================================================
> [snip cygcheck output]
> [snip *another* cygcheck output]
In the future, please *attach* the output of "cygcheck -svr" instead of
including it in-line. It cuts down on false positive matches in archive
searches.
HTH,
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pechtcha@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ igor@watson.ibm.com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/