Mail Archives: cygwin/2007/06/20/07:46:03
Hi,
I'm confused by the different timestamps for access and modfication
of a file that resides on a network drive.
I've set the cmd.exe prompt to '>' and do the following:
>dir /T:W 400000066.err | grep 400000066.err
13.08.2002 14:38 3.061 400000066.err
>dir /T:C 400000066.err | grep 400000066.err
13.08.2002 14:33 3.061 400000066.err
>dir /T:A 400000066.err | grep 400000066.err
20.06.2007 12:42 3.061 400000066.err
>ls -l --full-time --time=atime 400000066.err
-rw-r--r-- 1 loewjoha Domänen-Benutzer 3061 2007-06-20 12:51:42.023723400 +0200 400000066.err
>ls -l --full-time --time=ctime 400000066.err
-rw-r--r-- 1 loewjoha Domänen-Benutzer 3061 2007-06-16 06:05:49.764676100 +0200 400000066.err
>ls -l --full-time --time=atime 400000066.err
-rw-r--r-- 1 loewjoha Domänen-Benutzer 3061 2007-06-20 12:51:50.227005900 +0200 400000066.err
>dir /T:A 400000066.err | grep 400000066.err
20.06.2007 12:42 3.061 400000066.err
>dir /T:W 400000066.err | grep 400000066.err
13.08.2002 14:38 3.061 400000066.err
>dir /T:C 400000066.err | grep 400000066.err
13.08.2002 14:33 3.061 400000066.err
>type 400000066.err > c:\tmp\foobar
>dir /T:A 400000066.err | grep 400000066.err
20.06.2007 12:42 3.061 400000066.err
>ls --version
ls (GNU coreutils) 5.94
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.
Written by Richard Stallman and David MacKenzie.
>uname -a
CYGWIN_NT-5.0 lev-0002 1.5.19(0.150/4/2) 2006-01-20 13:28 i686 Cygwin
I'm confused that there exist at least four different (constant)
timestamps that can be displayed by 'dir /T:W', 'dir /T:A', 'dir /T:C', and
'ls -l --time=ctime'. I expected the times displayed by 'dir /T:C' and
'ls -l --time=ctime' to be the same.
I'm also confused that 'ls -l --time=atime' apparently modifies the atime of
the file.
I'm also confused by the fact that 'type 400000066.err' does not change the
access time displayed by 'dir' (but that's obviously no Cygwin problem).
On the local hard drive everything works as expected:
~/tmp/foo$ ls -l --full-time --time=ctime foo
-rw-r--r-- 1 loewjoha Domänen-Benutzer 4 2007-06-20 12:37:32.475250000 +0200 foo
~/tmp/foo$ ls -l --full-time --time=atime foo
-rw-r--r-- 1 loewjoha Domänen-Benutzer 4 2007-06-20 12:40:31.631500000 +0200 foo
~/tmp/foo$ ls -l --full-time --time=atime foo
-rw-r--r-- 1 loewjoha Domänen-Benutzer 4 2007-06-20 12:40:31.631500000 +0200 foo
~/tmp/foo$ cat foo
foo
~/tmp/foo$ ls -l --full-time --time=atime foo
-rw-r--r-- 1 loewjoha Domänen-Benutzer 4 2007-06-20 13:07:24.272125000 +0200 foo
~/tmp/foo$ ls -l --full-time --time=ctime foo
-rw-r--r-- 1 loewjoha Domänen-Benutzer 4 2007-06-20 12:37:32.475250000 +0200 foo
~/tmp/foo$
I stumbled across this when I tried to use find(1) to find files with an
access or modfication time not later than a certain day, but find(1) found
rather unexpected files.
So, the question I'd actually like to ask is: What is the Right Way (tm) to
find all files in a directory tree (on a network drive) that have been
accessed (alternatively modified) in the last x days?
Thanks in advance
Johannes
--
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/
- Raw text -