Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
It gets the File name and file size with output such as:my $mydir = "C:/Perl/bin/newr";
Inforserver is NT and my workstation is NT.use strict; my $mydir = "//Infoserver/directory"; opendir(DIR, $mydir) || die "Can not open directory $mydir: $!\n"; while (my $file = readdir(DIR)) { if ($file !~ /^\.+$/ && -M $mydir . '/' . $file > 1) { my $size = ((stat($file)) [7]); next if ((-z $file) || ($size < 100)); print "$file is $size\n"; last; #only give me one } } closedir(DIR);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Works locally but not on Info Server
by Fletch (Bishop) on Jan 16, 2003 at 20:21 UTC | |
|
Re: Works locally but not on Info Server
by Mr. Muskrat (Canon) on Jan 16, 2003 at 20:15 UTC | |
by Anonymous Monk on Jan 17, 2003 at 12:54 UTC | |
by Anonymous Monk on Jan 17, 2003 at 11:42 UTC | |
by Mr. Muskrat (Canon) on Jan 17, 2003 at 14:01 UTC | |
by Arien (Pilgrim) on Jan 18, 2003 at 05:33 UTC |