in reply to Reading a directory and getting file dates

I'm not sure whether this would work on Windows, but in Unix I would use stat.

Update: bart is right, the ctime field of Unix's stat's output is a poor substitute for the time of a file's creation. I don't recall ever needing time of creation for files (I always use the time of last modification), so I overlooked the "creation" part of the OP's question. My apologies. Fortunately, the Windows version of stat (as described in perlport) appears to be more suitable to the OP's goal than the Unix one would have been. So my suggestion turns out to be fortuitously on target.

the lowliest monk

  • Comment on Re: Reading a directory and getting file dates

Replies are listed 'Best First'.
Re^2: Reading a directory and getting file dates
by bart (Canon) on Jun 01, 2005 at 20:42 UTC
    Would you? Have you also checked that there is actually no field for the creation date? The closest you get is ctime, "inode change time", which might be creation time under some circumstances.

    perlport says:

    The "inode change timestamp" (the -C filetest) may really be the "creation timestamp" (which it is not in UNIX).