There are some problems in my python program.
I want to open a directory, choose the oldest file and then copy the file to another directory.
I read the documents where “shutil” is mentioned, but I don’t know how to choose the oldest one.
Could someone help me solve this problem?
The following example compares modification date, but you can of course change it to get other file-related times by changing the definition of
gttoos.path.getctimeoros.path.getatime, for example.