On 5/8/06, Graeme McLaren <[EMAIL PROTECTED]> wrote:
Hi all, I need to get the modified date of a file on the server, the code I have returns "Thu Jan 1 01:00:00 1970" even if I modify the file, so the modified date doesn't change.
That sounds as if the stat() failed.
open(HANDLE, $FILE);
open(HANDLE, $FILE) or die "Can't open '$FILE': $!";
my $date = localtime( (stat HANDLE)[9] );
I suspect that you don't have warnings turned on, either. But if the stat() works, that should give you the modification timestamp. Good luck with it! --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>