(quote from below):  "The file separator in perl is '/', not '\\'"
 
That's not necessarily true.  It depends on the module and the context.  Many 
modules will take the path in either format.  In this case Perl was 
interpreting their code correctly, because otherwise it would not have given 
the error indicated by the OP.
 
Remember that File::Find tries to change the current directory to be the 
directory of the file it is currently scanning.  The "System Volume 
Information" folder is blocked by the OS, so this error will happen.  I can 
think of two solutions off the top of my head (I don't have time to test).
 
1)  You could try taking off the "Show Hidden Files and Folders" option in 
Explorer, but depending on what you're looking for, this might keep you from 
searching through some of the files you need.
 
2)  Do something like this:
 
##############
 
use strict;
use warnings;
 
opendir(DIR,"c:\\") or die("Couldn't open 'c:\\' for reading!\n");
my @startDirs = readdir(DIR);
 
#for each directory that is not the System Volume Information folder
foreach my $dir(sort @startDirs){
    if((-d $dir) && ($dir ne 'System Volume Information')){
        find(\&wanted,"c:\\$dir");
    }
} 
 
###############

        -----Original Message----- 
        From: Charles K. Clarkson [mailto:[EMAIL PROTECTED] 
        Sent: Mon 12/26/2005 1:52 PM 
        To: beginners@perl.org 
        Cc: 
        Subject: RE: file :: find problem 
        
        

        <snip>

        :
        : find(\&wanted, "c:\\"
        
            The file separator in perl is '/', not '\\', functions parenthesis
        must match, and you should use single quotes by default.
        
        find( \&wanted, 'c:/' );
        
        <snip>

Reply via email to