Determining last time a file was accessed

John Abel john.abel at
Tue Feb 4 15:44:43 CET 2003


os.stat and st_atime should do the job.



Peter Markowsky wrote:

>Hi all,
>Basically my problem is that while working on a script to do inventory
>of files at work,  I noticed that some  files were over two  years old
>and that   I shouldn't even  consider these  for  my  inventory unless
>they've been accessed recently. So what I would  like to know is there
>a  way to  determine  the last  time a  file  has  been accessed using
>python? I'm currently  writing this script for  windows but would like
>to keep the script as platform  independent since I get the impression
>I'll need to run it on solaris later.

More information about the Python-list mailing list