CC: | martyn.pearce [...] gs.com |
Subject: | IO::All mkdir neither die()s nor returns code on failure |
IO::All::Dir::mkdir doesn't play nice if the mkdir fails - it doesn't
die(), nor does it return the failure code.
The patch below makes it die. I see empty() die()s on failure, while
open() calls $self->throw(...), so I wasn't sure what the "standard" is.
HTH,
Mx.
--- IO/All/Dir.pm.orig Thu Sep 23 13:06:00 2010
+++ IO/All/Dir.pm Thu Sep 23 13:24:20 2010
@@ -128,7 +128,8 @@
my $self = shift;
defined($self->perms)
? CORE::mkdir($self->pathname, $self->perms)
- : CORE::mkdir($self->pathname);
+ : CORE::mkdir($self->pathname)
+ or $self->throw("failed to mkdir " . $self->pathname . ": $!");
return $self;
}