in reply to Maintaining of config file

Are you sure you can't use chmod()?

Who ends up owning the files that your CGI writes? If it's the anonymous user, then you certainly can use chmod(). Several of my CGIs do.

Replies are listed 'Best First'.
Re: Re: Maintaining of config file
by Caillte (Friar) on Feb 27, 2001 at 16:37 UTC

    If changing permissions from 666 to 644 stops the script from writing to the file a second time then it has been created with the wrong user name. This can give you all sorts of implementation headaches down the line, as you are starting to see now. The normal user, for apache, is user nobody. I would suggest you use that user id to create all CGI record files that are to be written to or, a more robust idea, do not create these files at all. Instead allow the script to create the files it writes to if they go missing. This allows for fun things like files wandering off (it can happen) and makes your script more portable.

    $japh->{'Caillte'} = $me;