A
Abe
I have a strange Perl problem I don't understand. I've written the
following program to scan different disks on a Windows server to look
for directory files. Works fine until it gets to 'e:' when I get this
warning:
Can't stat e:: Unknown file or directory
(If I don't have the "use warnings" in the code I get no message.)
There are folders and files on e:. I don't understand what the
problem is but I suspect there's some kind of syntax issue.
use File::Find;
use warnings;
@disks = ('h:','g:','f:','e:','d:');
$rfile = "sharebug.txt";
open (OFILE, ">$rfile") || die "Can't Open $rfile: $!\n";
foreach $disk (@disks)
{
printf ">>>Search disk: %s\n", $disk;
printf OFILE ">>>Search disk: %s\n", $disk;
@dir = ($disk);
find (\&wanted, @dir);
$dir = ();
}
close (OFILE);
exit;
sub wanted
{
use warnings;
$fname = $_;
if (-d $fname)
{
printf OFILE "$File::Find::name\n";
}
}
** Due to SPAM I no longer receive email responses to
** newsgroup postings, so don't bother.
following program to scan different disks on a Windows server to look
for directory files. Works fine until it gets to 'e:' when I get this
warning:
Can't stat e:: Unknown file or directory
(If I don't have the "use warnings" in the code I get no message.)
There are folders and files on e:. I don't understand what the
problem is but I suspect there's some kind of syntax issue.
use File::Find;
use warnings;
@disks = ('h:','g:','f:','e:','d:');
$rfile = "sharebug.txt";
open (OFILE, ">$rfile") || die "Can't Open $rfile: $!\n";
foreach $disk (@disks)
{
printf ">>>Search disk: %s\n", $disk;
printf OFILE ">>>Search disk: %s\n", $disk;
@dir = ($disk);
find (\&wanted, @dir);
$dir = ();
}
close (OFILE);
exit;
sub wanted
{
use warnings;
$fname = $_;
if (-d $fname)
{
printf OFILE "$File::Find::name\n";
}
}
** Due to SPAM I no longer receive email responses to
** newsgroup postings, so don't bother.