I want to make a class that will run in a separate thread and delete the subdirectories in a separate directory depending on the time of the last subdirectory change. Is it safe to do this in a separate thread?
How to organize search and delete directories depending on time? This is how an error occurs:
def run(self): for current_directory, directories, files in os.walk(self.directory): print(current_directory) print(os.path.getatime(current_directory) - datetime.datetime.now())