develooper Front page | perl.beginners | Postings from March 2002

making parent directories

Thread Next
From:
zentara
Date:
March 5, 2002 10:43
Subject:
making parent directories
Message ID:
fc4a8uouk76r5fhcdeo26ur9bgfnunuj3d@4ax.com
Hi,

I was writing a script in which I needed to make
a directory "at depth", without having the parent directories
created yet.  For example:

#!/usr/bin/perl
use warnings;

mkdir("1/2/3", 0777) || die "cannot mkdir 1/2/3: $!";

Is there a way to deal with this without resorting to a 
system call?

In bash it's easy,
mkdir -p 1/2/3

So is there some way perl deals with this?




Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About