From patlee@panix.com Sun Apr 30 10:21:31 1995 Path: panix!patlee.nyc.ny.us!patlee From: patlee@panix.com (Patrick Lee) Newsgroups: panix.questions Subject: Re: Trying to write to a file via CGI script but ... Date: Mon, 27 Mar 1995 23:10:48 EST Organization: Stuyvesant H.S. Alumni Assoc. Web, http://www.panix.com/~stuy Lines: 26 Message-ID: References: <3l7u4s$1sk@news.panix.com> NNTP-Posting-Host: 198.7.7.17 X-Newsreader: Trumpet for Windows [Version 1.0 Rev B final beta #4] ckw@panix.com (Kirk Woerner) writes: > > open(FILE, "> /~ckw/myfile.txt"); > print FILE "some text\n"; > close(FILE); Remember, your perl script is running on anansi.panix.com, NOT one of panix?.panix.com machines. This is why this script will work when you try if >from the shell but not from anansi.panix.com. I highly doubt anansi has access to ANY hard disks on any of the other machines. So whatever files you create must live within the disk of anansi. > /net/htdocs/userdirs/ckw/data/myfile.txt /net/htdocs is an NFS pointer to /usr/local/net_public/httpd/htdocs on 198.7.0.64. The above path will not work when the script is executed on anansi. I am pretty sure the current directory is the directory where the script is executed. So instead of using absolute pathnames, use relative pathnames. It is much better so any changes in the filesystem won't affect your page. -- Patrick Lee Stuyvesant H.S. Alumni Assoc. Internet: patlee@panix.com Internet: alum@stuy.edu Web: http://www.panix.com/~patlee Web: http://www.panix.com/~stuy CompuServe: 74003,2566