Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi!

I have a problem with changing file permissions with a perl/cgi script.

I uploaded a file ("testfile.txt") using FTP software.

I wanted to change that file permission from 644 to 777 with using a perl/cgi script. I didn't want to use FTP software or unix command promt, so I wrote a script which executes a command: chmod(0777,"testfile.txt"); But the chmod() function returns a 0 or "Operation not permitted" which means I can't change the permission.

I've read this somewhere:

> changing the permissions will probably not work, because the CGI script will run under the > webserver's user id, which is likely to be different from your user id.

I don't quite understand it, because I uploaded both, the script and the file I want to change permission, with the same password (ID).

What needs to be done to make this script work?

Regards,
Bostjan Kocan

Originally posted as a Categorized Question.

  • Comment on How do I execute chmod() the right way?