holandes777 has asked for the wisdom of the Perl Monks concerning the following question:
When executed the browser shows "we are trying to write", the /var/www/html/DATA/kk.txt file exists, it is 666, owned by apache and has zero content.#!/usr/bin/perl use strict; print "Content-Type: text/html\r\n\r\n"; print "<HTML>\n"; print "<HEAD>\n"; print "</HEAD>\n"; print "<BODY>\n"; my $filename ="/var/www/html/DATA/kk.txt"; open(KK,">$filename"); close(KK); # this line and the nex +t 2 were not part of system("chmod 666 $filename"); # of the original code. + They were added to open(KK,">>$filename"); # see if changing the p +ermissions would help print "we are trying to write\n"; print KK "we are trying to write\n"; close(KK); print "</BODY>\n"; print "</HTML>\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: System and CGI - File Created but not the Content (Similar Situation)
by Joost (Canon) on Sep 18, 2007 at 15:41 UTC | |
|
Re: System and CGI - File Created but not the Content (Similar Situation)
by snopal (Pilgrim) on Sep 18, 2007 at 18:53 UTC | |
by holandes777 (Scribe) on Sep 23, 2007 at 14:31 UTC |