in reply to Re: Cannot open files using CGI
in thread Cannot open files using CGI

Yes, well spotted. I had not seen that. Doh!

With regards to the file permissions do these have to be changed when the file is uploaded to the server using e.g. O_RDRW and chmod 755.

The server is a whack biolinux server if that helps (dont know of it matters much if its the file permissions though).

Cheers
MonkPaul.

Replies are listed 'Best First'.
Re^2: Cannot open files using CGI
by graff (Chancellor) on May 30, 2005 at 00:51 UTC
    If the server that this cgi script is running on is a linux box, you damn well better not use backslashes at all in the path names for input or output files. As for setting permissions, the only thing you need to worry about is that the "user" account that is the web server has read+execute permission at each directory layer above the directory where file will be stored; and it must have read+write+execute on the storage directory.

    If the storage directory is owned by the web server user account, its permission can be 755; if it's owned by some other user, but has group ownership that matches the web server's group, then it can be 775. As for permissions on the files that are created, that's up to you.

      Ah, I seem to have hit a snag.
      Whay shouldnt i use back slashes with biolinux or linux box. Are they supposed to be forward slashes or something else (dumb question i know)?.

      MonkPaul.

        On all unix and linux systems, path names use forward slashes. Backslashes are for escaping characters on the command line (just like in perl).

        Update: if you really are that clueless about OS differences, you need File::Spec -- read the man page for that module, and start making a habit of using it. It's part of the perl core (a "built-in" module that is present whenever/wherever perl is installed), and it'll be your constant friend.