in reply to Stat not returning values for a directory on Windows XP
sub DirCheck { my $_dir = $_[0]; opendir(my $dh, $_dir) or die "Can't open directory $_dir: $!\n"; my @_dirStat = stat($dh) or die "Can't stat directory $_dir: $!\n"; closedir($dh); print "Directory: $_dir\n"; print "DirStat: " . @_dirStat . "\n"; for my $i (@_dirStat) { print "Item: $i\n"; } my $_mtime = $_dirStat[9]; print "Last Modified Time for $_dir: $_mtime\n"; }
(Removed useless quotes. Avoided global vars. They weren't even localised. Cleaned up error messages.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Stat not returning values for a directory on Windows XP
by scott_shea (Initiate) on Jan 18, 2010 at 19:44 UTC | |
by ikegami (Patriarch) on Jan 18, 2010 at 20:02 UTC | |
by scott_shea (Initiate) on Jan 18, 2010 at 20:15 UTC | |
by scott_shea (Initiate) on Jan 18, 2010 at 20:34 UTC |