in reply to Re: Oldest file using -M
in thread Oldest file using -M

If you want to make sure that -M always returns a positive value
No, that's no guarantee. Using utime, I can set the modtime to any value I want, including far into the future. Or, I might have unpacked a file from a tar-archive from a system with a badly set system clock.

So, you must always be prepared for a negative -M value. Always.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.