On Dec 6, 2003, at 5:27 PM, B. Fongo wrote:


I want to use mkdir(blah blah, o777), but want to first find out whether the directory "blah blah" exists.
I'm not if the -e option will bw right here. Let's say:


       unless (-e blah_blah) mkdir(blah_blah, 0777);
# Is this okay?

May I recommend File::Path and it's mkpath() for general useage...

that having been said, you might want to check
the return condition on your mkdir().

        unless ( -e $dir )
        {
                $dir_test = mkdir($dir, 0777);
                # code to handle the failed to mkdir here
        }

ciao
drieux

---


-- 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