Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am running File::Find 1.07 (ActiveState Perl 5.8.6) from the a cygwin command line on a deep file structure. File::Find dies with this error:
$ ./perl5.8.6 -MFile::Find -e 'sub w {1}; find (\&w, "\\\\usoaahs10\\c +ommon\\XYZ Production Support");' Can't cd to \\usvwoaahs100\common\gedas Production Support/MiscSystems +/unknown VB apps/Training Server/Michele Backup/Temporary Computer Ba +ckup/Documents and Settings/inacomp/Local Settings/Application Data/I +dentities/{0FEFDF2D-79B6-45A8-8ED8-AE6F59669687}/Microsoft../../../.. +/../../.. at d:/Perl586/lib/File/Find.pm line 928.
Microsoft is an empty directory at the very bottom of the structure. I can cd into that directory from the cygwin bash shell. It looks like a slash is missing between Microsoft and all the dot-dot-slash patterns. Any ideas? Thanks!

Replies are listed 'Best First'.
Re: File::Find bug? (MS bug)
by tye (Sage) on Jan 10, 2005 at 23:34 UTC

    You'll note that this path is over 255 characters (260?). You need to disable "path parsing" by starting the URL with \\?\ and you may need to use the "Unicode" APIs (not like you have any control over that). Which means you might not be able to get Perl and File::Find to work on such long paths.

    So how about making the path shorter by having "net use" (or Win32::NetResource) assign a drive letter to that network drive. You could even use the "subst" command to remove the "XYZ Production Support" from the path length by assigning a drive letter to that subdirectory.

    - tye        

Re: File::Find bug?
by dave_the_m (Monsignor) on Jan 10, 2005 at 22:19 UTC
    I'm not very familiar with cygwin, but what happens if you call find() with a /-delineated pathname rather than a \\ one?

    Dave.

      Exact same error.
      It works on a different system. I think it's a cygwin problem.
      $ ./Perl5.8.6 -e 'chdir "//usoaahs10/common/Production Support/MiscSys +tems/unknown VB apps/Training Server/Michele Backup/Temporary Compute +r Backup/Documents and Settings/inacomp/Local Settings/Application Da +ta/Identities/{0FEFDF2D-79B6-45A8-8ED8-AE6F59669687}/Microsoft" or di +e $!; chdir "../.." or die $!' No such file or directory at -e line 1.