This is the mail archive of the
mailing list for the Cygwin project.
AW: timestamp confusion
- From: Löwis, Johannes <Johannes dot Loewis at levitec dot de>
- To: <cygwin at cygwin dot com>
- Date: Wed, 20 Jun 2007 16:19:43 +0200
- Subject: AW: timestamp confusion
Eric Blake wrote:
> According to Löwis on 6/20/2007 5:45 AM:
> Some network file systems can support all four, many do not. At which
> point, you are at the mercy of what the file system supports,
> as well as
> what Windows supports when mapping to the remote file system.
According to the drive properties the remote FS is an NTFS.
> > I'm also confused that 'ls -l --time=atime' apparently modifies the atime of
> > the file.
> You're reading the metadata of a file - and in some cases on cygwin, that
> includes reading contents of the file to decide if it is executable; which
> means it can be enough of an access for the file system to consider
> updating the atime of that file. Sorry, but that's life.
I'm willing to give up my wish to find(1) files modified recently
because of this mess. Pity.
> > 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).
> Are you referring to the Windows type or the bash type here? You are
> right that we have no control over Window's type. Bash's
> type does not
> stat files, so I don't think it should be updating access times.
I was referring to Windows type.
> > 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
> When looking at timestamps, you may be interested in the stat
> command - less typing, and you get more information.
Thank you for this information.
But also with stat the access time of a file is modified on each call
if the file is in a network directory. Even with 'stat --printf="%x,%y,%z",
i.e., no information about executability requested.
> > 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.
> Ah, but some versions of find had bugs in this area. Try the
> newest find 4.3.8.
Maybe I'll try again after upgrading my cygwin installation.
> > 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?
> With find -atime or find -mtime.
That's the options I was having difficulties with.
I'm afraid it doesn't make much sense to 'find -atime' if a simple 'ls'
changes the access times of files.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html