I just cloned a drive and wanted to verify that all of the files got copied. What a great way to teach myself Perl. I've searched the net and can't find an explanation for what I'm seeing. Can anyone help? Here is the code (reduced to the basic elements):
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 is some of the output (out of hundreds of errors):
Can'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
Here are the results of a DIR command
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
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>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>
Is there a way to get Find to ignore these bogus directories? And can anyone tell me what they are?

Ok, I just figured out that they are JUNCTIONS, now how can I get find to ignore them?


In reply to File::Find giving unexpected results under windows by Joel

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.