Reply to topic
Script Does Folder Exist – If Not Create It
Lamont1701


Joined: 19 Sep 2006
Posts: 1
Reply with quote
Hello People,

I need a Windows 2003 server, Perl 5 Script, that will check to see if a Folder exist, and if the Folder does not exist, then create that Folder. (If the Folder does exist, then do nothing.)

I know nothing about Perl 5 yet, but I have a script running now that needs attention, like yesterday!


Is it possible for someone to help me?
cheryl


Joined: 17 Apr 2004
Posts: 84
Location: Newark, DE
Reply with quote
With perl, this should be fairly simple:

Code:

if ( not -d "c:\websites\mysite\mydir") {
        mkdir("c:\websites\mysite\mydir");
}


http://www.rexswain.com/perl5.html is a great reference guide - I usually head to it when I have problems.
Script Does Folder Exist – If Not Create It
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic