[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] BOUNCE macperl-anyperl@macperl.org: Non-member submission from [jake macmullin <jake.macmullin@flinders.edu.au>]



On Tue, Apr 11, 2000 at 05:15:47AM -0700, owner-macperl-anyperl@macperl.org wrote:
} >From macperl@cfcl.com  Tue Apr 11 05:15:36 2000
} X-Sent-To: <macperl-anyperl@macperl.org>
} Received: from goliath.camtech.net.au (goliath.camtech.net.au [203.5.73.2])
} 	by cfcl.com (8.9.2/8.9.2) with SMTP id FAA01178
} 	for <macperl-anyperl@macperl.org>; Tue, 11 Apr 2000 05:15:34 -0700 (PDT)
} Received: from [203.38.172.75] ([203.38.172.75]) by goliath.camtech.net.au ; Tue, 11 Apr 2000 19:39:04 +0930
} X-Sender: jakem@pop.camtech.net.au
} Message-Id: <v04003a00b518ac0fa077@[203.38.172.98]>
} Mime-Version: 1.0
} Content-Type: text/plain; charset="us-ascii"
} Date: Tue, 11 Apr 2000 20:50:26 +1030
} To: macperl-anyperl@macperl.org
} From: jake macmullin <jake.macmullin@flinders.edu.au>
} Subject: opening (creating) files on UNIX
} 
} Learning Perl on the Mac makes implementing it on UNIX seem awkward - :)
} 
} I'm having some difficulties porting a MacPerl script to a UNIX server.
} Basically, on the Mac if I want to create a file I just use open(FILE,
} ">>filename"). This works fine from the shell on UNIX, but when I try this
} in a CGI script, it doesn't like it. What am I doing wrong?

You're expecting that a CGI script would be permitted to open a file
in the same directory as the CGI.  A good Unix admin would never be
that brain dead.  Web servers generally run on Unix as a special
unprivileged user, and so can't write in many places, in particular in
the CGI directory or anywhere else in the publically accessible Web
site.

You just might be able to open ">>/tmp/filename", but you might not if
the admin has also put the Web server into what's called a "chrooted
jail", which is frequently done for security's sake.  In general,
CGI's should avoid using the filesystem.


} 
} Any help, even a pointer to a good resource, would be appreciated
} 
} Jake MacMullin
} 
} 

-- 
Paul Schinder
schinder@pobox.com

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org