Reputation: 783
I’m trying to compare the modification time of two files (that are being created on the same machine) using Perl just to know which file is older.
I have tried the –M
and stat and for some reason the results are not consistency. This is an example for what I have tried:
if ((stat($FileA))[9] < (stat("FileB"))[9]) {
This line sometimes work, but sometimes the results are just the opposite (the comparison should be at a seconds level and not just day \ hour).
Upvotes: 1
Views: 3323