delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/06/20/07:46:03

X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Subject: timestamp confusion
Date: Wed, 20 Jun 2007 13:45:38 +0200
Message-ID: <D95927B47773164A8149F384F079E56F0F6ACA@volta.lust.de>
From: =?iso-8859-1?Q?L=F6wis=2C_Johannes?= <Johannes DOT Loewis AT levitec DOT de>
To: <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id l5KBjpGR008496

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019