Joel has asked for the wisdom of the Perl Monks concerning the following question:
Here is some of the output (out of hundreds of errors):use strict; use warnings; use File::Find; find(\&process, 'F:'); sub process() { my $f = uc($File::Find::name); if ( -f $f) { my $c = $f; $c =~ s/^F:/C:/; if (-e $c) { if (-s $f != -s $c) { print "unequal size: $f\n"; } } else { print "missing in destination: $c\n"; } } }
Here are the results of a DIR commandCan't opendir(F:Users/Joel/Documents/My Music): Invalid argument at f1 +.pm line 6 Can't opendir(F:Users/Joel/Documents/My Pictures): Invalid argument at + f1.pm line 6 Can't opendir(F:Users/Joel/Documents/My Videos): Invalid argument at f +1.pm line 6
Notice that there is no "My " anything, why is File::Find acting like there is? Even stranger I can CD into "My Documents" but then it doesn't exist (even though I'm already there).C:\Users\Joel>dir Volume in drive C has no label. Volume Serial Number is DE8B-53F2 Directory of C:\Users\Joel 11/29/2010 01:51 PM <DIR> . 11/29/2010 01:51 PM <DIR> .. 02/07/2011 03:05 PM <DIR> Contacts 02/11/2011 01:11 PM <DIR> Desktop 02/07/2011 03:36 PM <DIR> Documents 02/11/2011 01:11 PM <DIR> Downloads 08/07/2010 02:16 AM <DIR> Favorites 08/07/2010 02:16 AM <DIR> Links 12/24/2010 07:21 PM <DIR> Music 02/07/2011 10:28 AM <DIR> Pictures 08/07/2010 02:16 AM <DIR> Saved Games 08/07/2010 02:16 AM <DIR> Searches 12/12/2009 05:08 PM 0 Sti_Trace.log 09/07/2010 06:58 AM <DIR> Videos 1 File(s) 0 bytes 13 Dir(s) 280,595,611,648 bytes free
Is there a way to get Find to ignore these bogus directories? And can anyone tell me what they are?C:\Users\Joel>cd "my documents" C:\Users\Joel\My Documents>dir Volume in drive C has no label. Volume Serial Number is DE8B-53F2 Directory of C:\Users\Joel\My Documents File Not Found C:\Users\Joel\My Documents>
Ok, I just figured out that they are JUNCTIONS, now how can I get find to ignore them?
|
|---|