in reply to Re: Create file in a specified directory
in thread Create file in a specified directory

Thank you. The code was failing because I didn't have the directory named 'Input' under the 'Public'. When I created that directory it worked

Is there a way to check the directory structure and create directories as specified in the path if it doesn't exist already?
  • Comment on Re^2: Create file in a specified directory

Replies are listed 'Best First'.
Re^3: Create file in a specified directory
by davidrw (Prior) on Sep 01, 2005 at 19:00 UTC
    use -d (perldoc -f -X) to check for exsistence.. for making a directory there's perldoc -f mkdir, and for making it recursively there's mkpath in File::Path
Re^3: Create file in a specified directory
by Anonymous Monk on Sep 01, 2005 at 19:01 UTC

    yes , sure you can check for that

    #check if the $dir does not exits then we create it if(!-d $dir){ mkdir($dir);}
    HTH