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!

mkdir()

Status
Not open for further replies.

youradds

Programmer
Jun 27, 2001
817
GB
Hi..maybe someone could shed some light on a mkdir() problem I'm having. Basically, I have the following code;


Code:
mkdir("$CFG->>{admin_root_path}/Net/Whois/Raw") || die "Can't create folder. Reason: $;

...but that gives me an error;

Code:
Not enough arguments for mkdir at (eval 8) line 83, near


I don't get this on *all* servers (about 3 in 10). I've tried changing it to;

Code:
mkdir($CFG->>{admin_root_path} . "/Net/Whois/Raw") || die "Can't create folder. Reason: $!";


.. but that still gives me the same error.

Anyone got any ideas? I just can't understand why it works on some version of Perl, and not others

TIA.

Andy
 
BTW, this is the whole bit of code;

# create folders ready for Net::Whois::Raw chmod(0777, $CFG->{admin_root_path}); if (-e "$CFG->{admin_root_path}/Net") { chmod(0777, $CFG->{admin_root_path} . "/Net"); } unless (-e "$CFG->{admin_root_path}/Net") { mkdir($CFG->{admin_root_path} . "/Net") or die "Can't create folder. Reason: $!"; } if (-e "$CFG->{admin_root_path}/Net/Whois") { chmod(0777, $CFG->{admin_root_path} . "/Net/Whois"); } unless (-e "$CFG->{admin_root_path}/Net/Whois") { mkdir($CFG->{admin_root_path} . "/Net/Whois") or die "Can't create folder. Reason: $!"; } if (-e "$CFG->{admin_root_path}/Net/Whois/Raw") { chmod(0777, $CFG->{admin_root_path} . "/Net/Whois/Raw"); } unless (-e "$CFG->{admin_root_path}/Net/Whois/Raw") { mkdir($CFG->{admin_root_path} . "/Net/Whois/Raw") or die "Can't create folder. Reason: $!"; } chmod(0755, $CFG->{admin_root_path});


Cheers

Andy
 
Check the versions of Perl, and if there's no difference, try sending a value for mode, (sets permissions on the directory

mkdir FILENAME MODE From Programming Perl - O'Reilly

HTH
--Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
The version of Perl is 5.6.

>>>mkdir FILENAME MODE From Programming Perl - O'Reilly<<<

What would MODE mean though? I'm a little confused as to what you are asking.

Cheers

Andy
 
on the ones that aren't working, try

mkdir &quot;yaddayadda/blah/blah&quot;, 0777;

This is only relevant for *nix I assume because NT handles its security more like VMS used to

--Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
Hi,

eventhough under Windows the mode is not interesting, it must be supllied with mkdir().

Greetings

--
Smash your head on keyboard to continue...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top