Re: How to access file last modified dates on each file in a directory

2006-10-29 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I am attempting to view all files in a directory and if those files > have not been modified within the last couple days I will remove them. > In order to do this I need to look at the file date modied and check > the date. I know how to look at each file name and I know

Re: How to access file last modified dates on each file in a directory

2006-10-29 Thread Jia Lu
[EMAIL PROTECTED] wrote: > Greetings, > > I am attempting to view all files in a directory and if those files > have not been modified within the last couple days I will remove them. > In order to do this I need to look at the file date modied and check > the date. I know how to look at each file

Re: How to access file last modified dates on each file in a directory

2006-10-29 Thread Praveen
I hope this sample code helps def getfileinfo(filename): print 'Filename : %s' % filename stats = os.stat(filename) size = stats[stat.ST_SIZE] print 'File Size is %d bytes' % size accessed = stats[stat.ST_ATIME] modified = stats[stat.ST_MTIME]

How to access file last modified dates on each file in a directory

2006-10-29 Thread RAMohrmann
Greetings, I am attempting to view all files in a directory and if those files have not been modified within the last couple days I will remove them. In order to do this I need to look at the file date modied and check the date. I know how to look at each file name and I know how to remove the fil