Skip Menu |

This queue is for tickets about the File-Path-Tiny CPAN distribution.

Report information
The Basics
Id: 79345
Status: resolved
Priority: 0/
Queue: File-Path-Tiny

People
Owner: Nobody in particular
Requestors: gpiero [...] rm-rf.it
Cc:
AdminCc:

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



Subject: Failed to recursively create dir if the first part solves to false
Date: Sat, 1 Sep 2012 19:13:43 +0200
To: bug-File-Path-Tiny [...] rt.cpan.org
From: Gian Piero Carrubba <gpiero [...] rm-rf.it>
gpiero@caimano test $ perl -MFile::Path::Tiny -E 'say $File::Path::Tiny::VERSION' 0.3 gpiero@caimano test $ perl -MFile::Path::Tiny -E 'File::Path::Tiny::mk("0/1/1/0/1") or die "$!"' No such file or directory at -e line 1. gpiero@caimano test $ perl -MFile::Path::Tiny -E 'File::Path::Tiny::mk("0") or die "$!"' gpiero@caimano test $ perl -MFile::Path::Tiny -E 'File::Path::Tiny::mk("0/1/1/0/1") or die "$!"' gpiero@caimano test $ tree 0 0 └── 1 └── 1 └── 0 └── 1 4 directories, 0 files The following patch should fix it ( but to be honest I'm not sure why that check is there ). --- Tiny.pm.ori 2012-04-04 22:33:56.000000000 +0200 +++ Tiny.pm 2012-09-01 19:01:01.321314554 +0200 @@ -10,7 +10,7 @@ $mask = oct($mask) if substr( $mask, 0, 1 ) eq '0'; require File::Spec; my ( $progressive, @parts ) = File::Spec->splitdir($path); - if ( !$progressive ) { + if ( !defined $progressive or $progressive eq '' ) { $progressive = File::Spec->catdir( $progressive, shift(@parts) ); } if ( !-d $progressive ) { Ciao, Gian Piero.
thanks! On Sat Sep 01 13:13:58 2012, gpiero@rm-rf.it wrote: Show quoted text
> gpiero@caimano test $ perl -MFile::Path::Tiny -E 'say > $File::Path::Tiny::VERSION' > 0.3 > gpiero@caimano test $ perl -MFile::Path::Tiny -E > 'File::Path::Tiny::mk("0/1/1/0/1") or die "$!"' > No such file or directory at -e line 1. > gpiero@caimano test $ perl -MFile::Path::Tiny -E > 'File::Path::Tiny::mk("0") or die "$!"' > gpiero@caimano test $ perl -MFile::Path::Tiny -E > 'File::Path::Tiny::mk("0/1/1/0/1") or die "$!"' > gpiero@caimano test $ tree 0 > 0 > └── 1 > └── 1 > └── 0 > └── 1 > > 4 directories, 0 files > > The following patch should fix it ( but to be honest I'm not sure why > that > check is there ). > > --- Tiny.pm.ori 2012-04-04 22:33:56.000000000 +0200 > +++ Tiny.pm 2012-09-01 19:01:01.321314554 +0200 > @@ -10,7 +10,7 @@ > $mask = oct($mask) if substr( $mask, 0, 1 ) eq '0'; > require File::Spec; > my ( $progressive, @parts ) = File::Spec->splitdir($path); > - if ( !$progressive ) { > + if ( !defined $progressive or $progressive eq '' ) { > $progressive = File::Spec->catdir( $progressive, > shift(@parts) ); > } > if ( !-d $progressive ) { > > > Ciao, > Gian Piero.
Should be fixed in v0.4 just uploaded to CPAN. I only did the !defined check per the code comment on the affected line. thanks again!