Wow
Im not sure you realize that the "wanted" sub gets passed directories too. i often have a return unless (-f $file); in there.
another thing the wanted sub can do is signal to prune the tree. $File::Find::prune = 1 is a signal to File::Find not to follow a directory. You want to prune junction points.
now you may even be able to contrive a test <.. some code to see if its a junction ..> that does not require "use Win32::LongPath", i dont know what it is now. Otherwise i think you are stuck trying to install that module. , sorry# this test for directory $stat->{mode} & S_IFDIR ? print "Directory\n" : print "File\n" +; # is the same as this one $stat->{attribs} & FILE_ATTRIBUTE_DIRECTORY ? print "Directory +\n" : print "File\n"; my $isjunction= <.. some code to see if its a junction ..> ; if ($isjunction){ $File::Find::prune = 1 return; }
In reply to Re^5: how to handle the warnings in a find statement
by huck
in thread how to handle the warnings in a find statement
by Aldebaran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |