Wobbel has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks, When was my textfile modified eg overwritten? My report is based on a textfile -"report.txt"- generated by Infomaker (HTML/CSS).With stat and ctime, it's easy to get the creationdate / time, but the modificationdate / time is a neverending story... I've seen a lot of UNIX solutions, but the WIN XP efforts resulted in weird hexadecimal codes, zero's etc. I thought, it would be a very usefull and often used snippet, but even Google I can't find a working solution... Summary: stuck in the mud. The cherry on the cake is missing...

Replies are listed 'Best First'.
Re: ctime versus mtime under WIN XP
by ikegami (Patriarch) on Dec 22, 2009 at 12:38 UTC

    I don't know what you're talking about. Getting the mtime works just as well on Windows as on unix systems.

    defined( my $mtime = ( stat($qfn) )[9] ) or die("Can't stat \"$qfn\": $!\n");

    By the way, ctime is not the creation time. It's the inode modification time. Re^3: File creation and last modifiication time shows the ctime changing.

Re: ctime versus mtime under WIN XP
by Wobbel (Acolyte) on Dec 30, 2009 at 20:17 UTC
    Finally, it works on another PC.... " I reinstalled the "problem PC" and now the original code works on this machine too. A waste of time and moreover, I still don't know what caused my headaches. Thanks for the usefull feedback!