Hi John,

John W. Krahn wrote on 26.07.2005:

>Jan Eden wrote:
>> Hi,
>
>Hello,
>
>> this does not work:
>> 
>> mkdir "/some/dir/newsubdir" or die "$!";
>
>That works for me.  What error message do you get?
>
I get "File exists". /some/dir does exist, but newsubdir does not.

>Have you tried the mkpath() function from the File::Path module?
>
Yes, I checked that just seconds after posting (apologies). mkpath() works for 
me.

But I wonder why my initial example works for you. File::Path doc says:

'The "mkpath" function provides a convenient way to create directories, even if 
your "mkdir" kernel call won't create more than one level of directory at a 
time. '

But my system's mkdir does execute

mkdir /some/dir/newsubdir

while this does not work via Perl's mkdir function.

Anyway, I will use File::Path.

Thanks,

Jan
-- 
Life's unfair - but root password helps!

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to