diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-03-20 14:26:25 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-03-20 14:26:25 +0000 |
commit | ffb9ee5f5f9d80d28ce950a2ff357650c8f1cc03 (patch) | |
tree | 065b90856aa6705ae5964db3da0d0b33fad0193c | |
parent | 365eb2691f2468a9598fb53f37793b96456cfd99 (diff) | |
download | perl-ffb9ee5f5f9d80d28ce950a2ff357650c8f1cc03.tar.gz |
Integrate changes #9259,9260 from maintperl into mainline.
Subject: [MacPerl-Porters] [PATCH] POSIX, File::Path (Mac OS) for 5.6.1 and 5.7
Subject: [PATCH perl-5.6.1-TRIAL3/run.c] printf warning
p4raw-link: @9260 on //depot/maint-5.6/perl: b83ee361c1b8f0045f0125bffa546780643848c4
p4raw-link: @9259 on //depot/maint-5.6/perl: 5a271d91b72f558a378756b049d1040c9ff0a63c
p4raw-id: //depot/perl@9261
p4raw-integrated: from //depot/maint-5.6/perl@9258 'copy in'
lib/File/Path.pm (@8175..) 'merge in' ext/POSIX/POSIX.xs
(@8885..) run.c (@8987..)
-rw-r--r-- | ext/POSIX/POSIX.xs | 2 | ||||
-rw-r--r-- | lib/File/Path.pm | 18 | ||||
-rw-r--r-- | run.c | 2 |
3 files changed, 15 insertions, 7 deletions
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index 83498ed1bc..b5fd3a995b 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -155,8 +155,6 @@ # endif /* !HAS_MKFIFO */ # ifdef MACOS_TRADITIONAL - struct tms { time_t tms_utime, tms_stime, tms_cutime, tms_cstime; }; -# define times(a) not_here("times") # define ttyname(a) (char*)not_here("ttyname") # define tzset() not_here("tzset") # else diff --git a/lib/File/Path.pm b/lib/File/Path.pm index 3859f248eb..0eb6128afe 100644 --- a/lib/File/Path.pm +++ b/lib/File/Path.pm @@ -97,11 +97,12 @@ use File::Basename (); use Exporter (); use strict; -our $VERSION = "1.0403"; +our $VERSION = "1.0404"; our @ISA = qw( Exporter ); our @EXPORT = qw( mkpath rmtree ); my $Is_VMS = $^O eq 'VMS'; +my $Is_MacOS = $^O eq 'MacOS'; # These OSes complain if you want to remove a file that you have no # write permission to: @@ -113,7 +114,7 @@ sub mkpath { # $paths -- either a path string or ref to list of paths # $verbose -- optional print "mkdir $path" for each directory created # $mode -- optional permissions, defaults to 0777 - local($")="/"; + local($")=$Is_MacOS ? ":" : "/"; $mode = 0777 unless defined($mode); $paths = [$paths] unless ref $paths; my(@created,$path); @@ -160,7 +161,12 @@ sub rmtree { my($root); foreach $root (@{$roots}) { - $root =~ s#/\z##; + if ($Is_MacOS) { + $root = ":$root" if $root !~ /:/; + $root =~ s#([^:])\z#$1:#; + } else { + $root =~ s#/\z##; + } (undef, undef, my $rp) = lstat $root or next; $rp &= 07777; # don't forget setuid, setgid, sticky bits if ( -d _ ) { @@ -185,7 +191,11 @@ sub rmtree { # is faster if done in reverse ASCIIbetical order @files = reverse @files if $Is_VMS; ($root = VMS::Filespec::unixify($root)) =~ s#\.dir\z## if $Is_VMS; - @files = map("$root/$_", grep $_!~/^\.{1,2}\z/s,@files); + if ($Is_MacOS) { + @files = map("$root$_", @files); + } else { + @files = map("$root/$_", grep $_!~/^\.{1,2}\z/s,@files); + } $count += rmtree(\@files,$verbose,$safe); if ($safe && ($Is_VMS ? !&VMS::Filespec::candelete($root) : !-w $root)) { @@ -90,7 +90,7 @@ Perl_debop(pTHX_ OP *o) if (svp) PerlIO_printf(Perl_debug_log, "(%s)", SvPV(*svp,n_a)); else - PerlIO_printf(Perl_debug_log, "[%"UVuf"]", o->op_targ); + PerlIO_printf(Perl_debug_log, "[%"UVuf"]", (UV)o->op_targ); break; default: break; |