I\'m trying to use the newest file in the \'upload\' directory with \'.log\' extension to be processed by Python. I use a Ubuntu web server and file upload is done
Ubuntu
The problem is that the logical inverse of max is min:
max
min
newest = max(glob.iglob('upload/*.log'), key=os.path.getctime)
For your purposes should be:
newest = min(glob.iglob('upload/*.log'), key=os.path.getctime)