CHMOD in Perl failure

They have: 193 posts

Joined: Feb 2000

I am attempting at writing a script that creates a directory, then creates a file in that directory, and then chmods them.

Thus far the script successfully creates the file and directory, but the chmod command is failing, but does not die. I don't understand. Here follows my code:

code:

chmod (755, $file_path, $dir) | | die "failed chmod  Reason: $!";
[/code]

Currently, the files remain at what seems like 0 permissions.  :-(

Thanks a lot.

Richard

------------------
     [email protected]      

"I'm so wracked with guilt. I don't want to stop therapy 
because I'm afraid to take the income away from my therapist. 
He's got kids in college."
-- Tim Halpern 

[email protected]

Everyone here has a website. It's just that not all are worth posting (Mine! Smiling).

They have: 568 posts

Joined: Nov 1999

CGI scripts execute as user "nobody" if the server admin didn't want that user to have the ability to chmod files then he could set it to that.

They have: 193 posts

Joined: Feb 2000

I made the script do a whoami call and print it out, the results are my name; so they should be executed under my rights. If there is not syntax error, then I will contact my host.

Thanks,
Richard

------------------
[email protected]

"I'm so wracked with guilt. I don't want to stop therapy
because I'm afraid to take the income away from my therapist.
He's got kids in college."
-- Tim Halpern

[email protected]

Everyone here has a website. It's just that not all are worth posting (Mine! Smiling).

They have: 20 posts

Joined: May 2000

Can you post the error message in your error log file so that we can help you better?

They have: 193 posts

Joined: Feb 2000

Tanks for your insterest in helping, but I figured out the problem.

Instead of:

code:

chmod (755, $file_path, $dir) | | die "failed chmod  Reason: $!";
[/code]

It should be:
code:
chmod (0755, $file_path, $dir) | | die "failed chmod  Reason: $!";
[/code]

You'll notice it won't work without the zero, or a 1, whichever you want.

Thanks again.

Richard

------------------
     [email protected]      

"I'm so wracked with guilt. I don't want to stop therapy 
because I'm afraid to take the income away from my therapist. 
He's got kids in college."
-- Tim Halpern 

[email protected]

Everyone here has a website. It's just that not all are worth posting (Mine! Smiling).

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.