getatime() changes atime on cygwin

Thomas Guettler zopestoller at thomas-guettler.de
Mon Jul 1 06:18:54 EDT 2002


Hi!

time.getatime() (access time) changes the atime on cygwin.

If a run the following script twice. The atime
got changed by the first run.

Version:
Python 2.2 (#1, Dec 31 2001, 15:21:18)
[GCC 2.95.3-5 (cygwin special)] on cygwin

If I use the native version, the access time does not get
changed by calling time.getatime()

Version:
Python 2.2 (#28, Dec 21 2001, 12:21:22) [MSC 32 bit (Intel)] on win32

The next strange thing: 'cat foo.txt' in cygwin does not change the
atime which you get if you call the getatime() in win32 python.
If I open it in an windows application it get changed.

Any hints, suggestions?

BTW:

I use this script for displaying the atime recursively:

import os.path
import time

def print_atime(arg, dirname, files):
     for file in files:
         file=os.path.join(dirname, file)
         time_str=time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(
             os.path.getatime(file)))
         print file, time_str

os.path.walk(os.getcwd(), print_atime, None)




More information about the Python-list mailing list