diff options
author | Craig A. Berry <craigberry@mac.com> | 2007-09-10 22:40:30 +0000 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2007-09-10 22:40:30 +0000 |
commit | b5400373f6bb87489df5aa1a3eeb261ec6412884 (patch) | |
tree | 874f740eb1c646c4ba13148a5fc4be81da807d40 /lib/File | |
parent | 7cd91da4aacbc06cf77f68a39f56e59a16d393bb (diff) | |
download | perl-b5400373f6bb87489df5aa1a3eeb261ec6412884.tar.gz |
VMS help for File::Path 2.00_11: chdir() is finicky about directory
format; catdir spews warnings when given files that aren't directories;
File::Spec functions may call stat(), thus zapping C<_>; filenames with
characters that need escaping (such as spaces), must have some path
syntax attached to them and be converted to native syntax in order to
force escaping to take place.
p4raw-id: //depot/perl@31843
Diffstat (limited to 'lib/File')
-rw-r--r-- | lib/File/Path.pm | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/File/Path.pm b/lib/File/Path.pm index 274512e37d..c6a4f66a1c 100644 --- a/lib/File/Path.pm +++ b/lib/File/Path.pm @@ -522,7 +522,7 @@ BEGIN { use Exporter (); use vars qw($VERSION @ISA @EXPORT); -$VERSION = '2.00_11'; +$VERSION = '2.00_12'; @ISA = qw(Exporter); @EXPORT = qw(mkpath rmtree); @@ -708,7 +708,6 @@ sub _rmtree { else { $root =~ s{/\z}{}; } - my ($ldev, $lino, $perm) = (lstat $root)[0,1,2] or next; # since we chdir into each directory, it may not be obvious # to figure out where we are if we generate a message about @@ -717,11 +716,14 @@ sub _rmtree { # opposed to being truly canonical, anchored from the root (/). my $canon = $arg->{prefix} - ? File::Spec->catdir($arg->{prefix}, $root) + ? File::Spec->catfile($arg->{prefix}, $root) : $root ; + my ($ldev, $lino, $perm) = (lstat $root)[0,1,2] or next; + if ( -d _ ) { + $root = VMS::Filespec::pathify($root) if $Is_VMS; if (!chdir($root)) { # see if we can escalate privileges to get in # (e.g. funny protection mask such as -w- instead of rwx) @@ -840,6 +842,10 @@ sub _rmtree { } else { # not a directory + + $root = VMS::Filespec::vmsify("./$root") + if $Is_VMS && !File::Spec->file_name_is_absolute($root); + if ($arg->{safe} && ($Is_VMS ? !&VMS::Filespec::candelete($root) : !(-l $root || -w $root))) |