From: Craig A. Berry Date: Mon, 10 Sep 2007 22:40:30 +0000 (+0000) Subject: VMS help for File::Path 2.00_11: chdir() is finicky about directory X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b5400373f6bb87489df5aa1a3eeb261ec6412884;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/lib/File/Path.pm b/lib/File/Path.pm index 274512e..c6a4f66 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)))