Comparing file last access date

kaklis at kaklis at
Sun Feb 14 18:59:12 CET 2010

Hi to all,
what i want is to search a folder, and if the last access date of the
files in that folder is greater than, lets say 7 days, those files
deleted. (Somekind of a file cleaner script)
I had problems with converting

now = today =
stats = os.stat(file)
lastAccessDate = time.localtime(stats[7])

into matching formats so that
     if (now - lastAccessDate) > 7:
                 delete the file

what i do wrong
Thanks in advance

More information about the Python-list mailing list