Can't stat e:: Unknown file or directory - why?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

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

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.

Here's the code.  When I run it with this list of disks:

@disks = ('h:','g:','f:','e:','d:');

I get the "Can't stat:" warning when it gets to e:

If I change the line to this:

@disks = ('h:','g:','f:','e:\','d:');

it reports the folders on e: properly.  I just don't understand why?

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;
  find (\&wanted, $disk);
close (OFILE);

sub wanted
  $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.

Site Timeline