* Andrew Brosnan <andrew@broscom.com>
> I'm using File::Path's mkpath() function in a script run by Apache on
> Mac OS X 10.3 and Perl 5.8.1. It works fine when only creating a
> single directory, but as soon as it tries to create more than one
> directory level, it fails. Below is the relevant code and error. Can
> anyone see anything wrong, or have others seen this before?
Permissions problem, perhaps?
http://sial.org/howto/debug/unix/parsepath
I do not recall seeing mkpath problems on 10.3, and the following works
for me under perl 5.8.6 on 10.4:
#!/usr/bin/perl -w
use strict;
use File::Path qw(mkpath);
use File::Spec ();
my $target_path = File::Spec->catfile( '/tmp', random_numbers() );
warn "info: creating path: name=$target_path\n";
eval { mkpath($target_path); };
if ($@) {
die "error: problem creating path: errno=$@, name=$target_path\n";
}
sub random_numbers {
return split //, $$;
}