Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the IO-All CPAN distribution.

Report information
The Basics
Id: 61697
Status: resolved
Priority: 0/
Queue: IO-All

People
Owner: Nobody in particular
Requestors: fluffy [...] cpan.org
Cc: martyn.pearce [...] gs.com
AdminCc:

Bug Information
Severity: Important
Broken in: 0.41
Fixed in: (no value)



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; }
IO::All does not die much. I agree it should return 0 or 1 on all methods. I also want to support a: use IO::All -strict; that dies on any failure. I'll work on the first one sooner and the last one later. :) On Mon Sep 27 12:56:33 2010, FLUFFY wrote: Show quoted text
> 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; > }
On Wed Jun 01 10:05:59 2011, INGY wrote: Show quoted text
> IO::All does not die much. I agree it should return 0 or 1 on all > methods. I also want to support a: > > use IO::All -strict; > > that dies on any failure. I'll work on the first one sooner and the last > one later. :) > > > On Mon Sep 27 12:56:33 2010, FLUFFY wrote:
> > 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; > > }
> >
Fixed with die
On Fri Jan 17 19:37:00 2014, frew wrote: Show quoted text
> On Wed Jun 01 10:05:59 2011, INGY wrote:
> > IO::All does not die much. I agree it should return 0 or 1 on all > > methods. I also want to support a: > > > > use IO::All -strict; > > > > that dies on any failure. I'll work on the first one sooner and the > > last > > one later. :) > > > > > > On Mon Sep 27 12:56:33 2010, FLUFFY wrote:
> > > 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; > > > }
> > > >
> > Fixed with die