Enclosed is a workaround that I think gave me
a File::Find that would not wander off following
logical names to other places in the VMS file system.

The essential trick is to use:

    chdir("$name");

where $name contains something like 'foo.dir' instead
of just 'foo'.  This contrast with previous speculation of
mine where I thought that temporarily changing the content
of $name to be "./foo" and then changing it back would help.
It turns out that the 'foo.dir' form was used in the File::Find
implementation with perl 5.005_02.

I note further that this is only a workaround for now.
Among other things the return order of names differs
from what File::Find as shipped with perl 5.005_02
gave.  Perhaps more importantly this change to Find.pm
means more perl regression tests fail rather than succeed
and I have only begun to struggle with the main test for
File::Find, namely lib/File/Find/t/find.t which now fails
many tests.  In addition I see these new failures:

lib/AutoSplit........................FAILED at test 3

lib/ExtUtils/t/Manifest..............FAILED at test 18
lib/File/Find/t/find.................FAILED at test 19
lib/File/Find/t/taint................FAILED at test 20

lib/h2xs.............................FAILED at test 15

t/pod/find...........................FAILED at test 2

Hence this is not a patch but simply a possible fix for further discussion:

--- lib/file/find.pm;1  Sun May 18 09:03:15 2003
+++ lib/File/Find.pm    Tue Jun 17 21:42:36 2003
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use warnings::register;
-our $VERSION = '1.04';
+our $VERSION = '1.05';
 require Exporter;
 require Cwd;

@@ -830,6 +830,8 @@

      $dir= $dir_name; # $File::Find::dir

+     $dir =~ s/\.dir\z// if $Is_VMS;
+
      # Get the list of files in the current directory.
      unless (opendir DIR, ($no_chdir ? $dir_name :
$File::Find::current_dir)) {
          warnings::warnif "Can't opendir($dir_name): $!\n";
@@ -876,7 +878,7 @@

                if (-d _) {
                  --$subcount;
-                 $FN =~ s/\.dir\z// if $Is_VMS;
+                 $dir_name =~ s/\.dir\z// if $Is_VMS;
                  # HACK: replace push to preserve dir traversal order
                  #push @Stack,[$CdLvl,$dir_name,$FN,$sub_nlink];
                  splice @Stack, $stack_top, 0,
I hope that helps.

Peter Prymmer

Reply via email to