From: Rafael Garcia-Suarez Date: Fri, 26 Jan 2007 11:21:17 +0000 (+0000) Subject: Let File::Path report the extended system error message X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dde45d8ef2c2172c2def19cf91865bf36548d0b5;p=p5sagit%2Fp5-mst-13.2.git Let File::Path report the extended system error message when available (Ilya Zakharevich) p4raw-id: //depot/perl@30002 --- diff --git a/lib/File/Path.pm b/lib/File/Path.pm index 793336e..002b9ef 100644 --- a/lib/File/Path.pm +++ b/lib/File/Path.pm @@ -125,7 +125,7 @@ use Exporter (); use strict; use warnings; -our $VERSION = "1.08"; +our $VERSION = "1.09"; our @ISA = qw( Exporter ); our @EXPORT = qw( mkpath rmtree ); @@ -167,10 +167,11 @@ sub mkpath { 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 = $!; + my ($e, $e1) = ($!, $^E); + $e .= "; $e1" if $e ne $e1; # allow for another process to have created it meanwhile $! = $e, croak ("mkdir $path: $e") unless -d $path; }