in reply to Re: Re: A little help w/ stat() por favor...
in thread A little help w/ stat() por favor...

Oops, sorry... that should have been:
$mtime = (stat($files))[9];

-Blake

Replies are listed 'Best First'.
Re: Re: Re: Re: A little help w/ stat() por favor...
by augamecock (Novice) on Jan 11, 2002 at 06:54 UTC
    Thanks again Blake.. Still just giving me 1's. I tried
    $size = (stat($files))[7];
    because i definetly know the size of the file and it still gave me 1's. I dont get this. I thought this would be something pretty easy for me to figure out.
      Is $files a relative path? I think stat needs the full path to the file. Try something like this:
      #!/usr/bin/perl -wT use strict; my $dir = "/var/www/html/file"; my @files; opendir (FILE,$dir) || die "'$dir' $!"; @files = grep {-f "$dir/$_"} readdir (FILE); closedir (FILE) || die $!; foreach my $file (sort(@files)) { my $mtime = (stat("$dir/$file"))[9]; print "$mtime => $file\n"; };

      -Blake

Re: Re: Re: Re: A little help w/ stat() por favor...
by augamecock (Novice) on Jan 11, 2002 at 06:55 UTC
    Still giving me 1's. I tried with $size and $uid. All give me just the number 1