Python: Deleting files of a certain age -
Then at this time I'm trying to delete the files listed in the 1 minute old directory, I will change that value one The time I have the script is working. In the code below, there is an error: AttributeError: 'str' object has no attribute in 'mtime'
import time import OS Oslistdir (folder ) #from path import path for a file in seven_days_ago = time.time () - 60 folder = '/ home / rv / desktop / test': if int (somefile.mtime) & lt; Seven_days_ago: somefile.remove ()
Comments
Post a Comment