in reply to Re^5: File creation and last modifiication time
in thread File creation and last modifiication time

Oh, and I just assumed that "last file" meant something like "file with the latest creation timestamp".
Well, I would think that "last file" means "file last created". Now many file system do not have a creation timestamp, and for the filesystems that do, Perl doesn't have a dedicated way to access them.
To get the oldest file, use -M instead of -s.
-M has nothing to do with 'oldness' of a file. It has everything to do with last modification time. Which isn't the same as age of a file. As such, -M cannot be used to determine a directory's "oldest file".
  • Comment on Re^6: File creation and last modifiication time

Replies are listed 'Best First'.
Re^7: File creation and last modifiication time
by moritz (Cardinal) on Aug 21, 2009 at 12:12 UTC
    M has nothing to do with 'oldness' of a file. It has everything to do with last modification time. Which isn't the same as age of a file. As such, -M cannot be used to determine a directory's "oldest file".

    That's correct. And that's the reason why I also linked to the other google search which shows how to determine the creation time on windows.

    I never said that any of the google hits had the complete solution, I just want to point out that they give you enough material to solve the problem. Effort is still required, though.

    Perl 6 projects - links to (nearly) everything that is Perl 6.