diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-10-25 21:27:08 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-10-25 21:27:08 +0000 |
commit | da5a79ee770004a39d15799b4520ca27a15121c5 (patch) | |
tree | 8779688219e986258378806ada1cd97ffcb8634e /lib/File | |
parent | e22b345228eb54b4193a6e26cae6125773c5ce60 (diff) | |
parent | 6a988a413c9d0e6abca3ab868bc36cea62cb1fc1 (diff) | |
download | perl-da5a79ee770004a39d15799b4520ca27a15121c5.tar.gz |
Integrate with vmsperl #7430 by Charles Bailey:
Cleanup from prior patch (Charles Lane?):
- improve handling of MFDs in Basename and Path
- default to no xsubpp line # munging when building debug images
p4raw-id: //depot/perl@7445
Diffstat (limited to 'lib/File')
-rw-r--r-- | lib/File/Basename.pm | 8 | ||||
-rw-r--r-- | lib/File/Path.pm | 17 |
2 files changed, 16 insertions, 9 deletions
diff --git a/lib/File/Basename.pm b/lib/File/Basename.pm index 4581e7e93c..243234403a 100644 --- a/lib/File/Basename.pm +++ b/lib/File/Basename.pm @@ -189,9 +189,13 @@ sub fileparse { } elsif ($fstype !~ /^VMS/i) { # default to Unix ($dirpath,$basename) = ($fullname =~ m#^(.*/)?(.*)#s); - if ($^O eq 'VMS' and $fullname =~ m:/[^/]+/000000/?:) { + if ($^O eq 'VMS' and $fullname =~ m:^(/[^/]+/000000(/|$))(.*):) { # dev:[000000] is top of VMS tree, similar to Unix '/' - ($basename,$dirpath) = ('',$fullname); + # so strip it off and treat the rest as "normal" + my $devspec = $1; + my $remainder = $3; + ($dirpath,$basename) = ($remainder =~ m#^(.*/)?(.*)#s); + $dirpath = $devspec.$dirpath; } $dirpath = './' unless $dirpath; } diff --git a/lib/File/Path.pm b/lib/File/Path.pm index daa2eae0fb..8b0772d0e1 100644 --- a/lib/File/Path.pm +++ b/lib/File/Path.pm @@ -119,16 +119,19 @@ sub mkpath { my(@created,$path); foreach $path (@$paths) { $path .= '/' if $^O eq 'os2' and $path =~ /^\w:\z/s; # feature of CRT - next if -d $path; # Logic wants Unix paths, so go with the flow. - $path = VMS::Filespec::unixify($path) if $Is_VMS; - my $parent = File::Basename::dirname($path); - # Allow for creation of new logical filesystems under VMS - if (not $Is_VMS or $parent !~ m:/[^/]+/000000/?:) { - unless (-d $parent or $path eq $parent) { - push(@created,mkpath($parent, $verbose, $mode)); + if ($Is_VMS) { + next if $path eq '/'; + $path = VMS::Filespec::unixify($path); + if ($path =~ m:^(/[^/]+)/?\z:) { + $path = $1.'/000000'; } } + next if -d $path; + my $parent = File::Basename::dirname($path); + unless (-d $parent or $path eq $parent) { + push(@created,mkpath($parent, $verbose, $mode)); + } print "mkdir $path\n" if $verbose; unless (mkdir($path,$mode)) { my $e = $!; |