sandy1028 has asked for the wisdom of the Perl Monks concerning the following question:
The above code doesnot give the age for the directory. It shows as 0 always. How can we find the age of both file and directoryopendir(DIR, $dirname) || die "can't opendir $dirname': $!"; @dots = readdir(DIR); closedir DIR; foreach $file (@dots){ my $diff = -M $file; print "The age is" .int($diff)."\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Age of directory
by Corion (Patriarch) on Mar 17, 2009 at 12:03 UTC | |
|
Re: Age of directory
by ig (Vicar) on Mar 18, 2009 at 03:57 UTC | |
by sandy1028 (Sexton) on Mar 18, 2009 at 04:25 UTC | |
by ig (Vicar) on Mar 20, 2009 at 00:01 UTC |