I want to check if a file is older than a certain amount of time (e.g. 2 days).
I managed to get the file creation time in such a way:
>>> import os.path, time
>>> fileCreation = os.path.getctime(file)
'Mon Aug 22 14:20:38 2011'
now = time.time() twodays_ago = now - 60*60*24*2 # Number of seconds in two days if fileCreation < twodays_ago: print "File is more than two days old"