You could also use -d on the actual name of the directory to see if it
exists before you try to create it.
my $dir="foo";
mkdir 'foo', 0744 unless (-d $dir);
HTH
-dave
On Thu, 16 Aug 2001 14:20:34 -0500, David Simcik wrote:
>Hey folks,
> This would seem to be a trivial thing, but I can't find a great answer
>anywhere for it. I want to do a mkdir, but before I do, I want to confirm
>that the dir I'm about to make doesn't already exist.
>
>Would the -X operators (particularily -e) work with DIRHANDLES??? That
>would
>certainly make my life easier. Otherwise, the only other option I can
>think
>of is to do a Opendir() before the Mkdir and test to ensure that the
>Opendir
>fails. That's a bit kludgey in my mind, so can anyone shed some light on
>the
>situation?
>
>THanks!
>DTS
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
--
David Rankin
President, Surf This! Web Design Inc.
Tel: 401.277.9966/877.528.5213
Fax: 603.590.4925
Email: [EMAIL PROTECTED]
http://www.surfthisdesign.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]