Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using mkdir ()

Status
Not open for further replies.

grazinggoat

Programmer
Mar 12, 2008
41
US
I'm a perl newbie...

Can anyone tell me why mkdir will not allow me to make /tmp/system/logs. How do I get around this.. do I have to call mkdir by system? I suspect its because I would need mkdir -p but still couldn't get it to create. thanx in advanced

#!/usr/bin/perl


$ArchiveRootDir = "/tmp/system/logs"; # Archive Root/Base dir


# Check if /etrade/logs exist
unless ( -d $ArchiveRootDir ) {
print "Could not find $ArchiveRootDir. Creating...\n";
mkdir("$ArchiveRootDir", 0777) or die("Could not Create $ArchiveRootDir");
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top