in reply to RE: Re: How do I create files on the server?
in thread How do I create files on the server?

It sounds like the server is set up the same as mine; hands off anything created by Apache, unless you're in the same group. It simplifies security. Why not just create an empty file on the server, and copy it to the new name? So first you'd prepare it with: (assuming *nix)
touch blank.file
and in your code: (I haven't had my coffee yet, so this isn't Perl; it's psuedocode.)
if ( need_new_file() ) { copy( blank.file, new.file ); } open( *NEW_FILE, ">>new.file" ); print NEW_FILE $stuff; close NEW_FILE;

Okay, it's a kludge. But, it works. And without needing extra permissions.

Paris Sinclair    |    4a75737420416e6f74686572
pariss@efn.org    |    205065726c204861636b6572
I wear my Geek Code on my finger.

Replies are listed 'Best First'.
RE: RE: RE: Re: How do I create files on the server?
by Anonymous Monk on Jul 17, 2000 at 07:10 UTC
    So the "touch" part is actually precreating the file? Not part of the script? This is exactly what I'm trying to avoid.
      Right. But, having access to files _created_ by the webserver is proabably what the sysadmin is trying to avoid... if you don't have permissions, don't have the access to change the permissions, are you sure you'll be allowed to run setuid scripts?
      Paris Sinclair    |    4a75737420416e6f74686572
      pariss@efn.org    |    205065726c204861636b6572
      I wear my Geek Code on my finger.
      
        Yeah, this is in intranet project and security is not a big issue. I'm in total control.