It shows that you are unregistered. Please register with us by clicking Here
![]() |
|
![]() |
![]() | Register - FAQ - Today's Posts - New Posts - Support - Search | ![]() |
|
|
#1 (permalink) |
|
Junior Member
Join Date: Jul 2006
Age: 48
Posts: 10
|
This is a problem from a cgi script but I can't see how it can be an apache/cgi problem. I have a cgi script that tries to open a file int eh cgi-bin folder for writing. the -W and -w tests show that the script can write to the file. However when I try to open the file using open(THEFILE ">>/var/www/cgi-bin/file.txt" I get a failure with permission denied in the $! variable. It have tried every possible permissions setting on the file itself and the folder it lives in. Is there some situation wehre the -w and -W tests fail to work?
Thanks Jasmine |
|
|
|
|
|
|
|
#2 (permalink) |
|
Member
Join Date: Jul 2006
Age: 25
Posts: 53
|
Hey can you write here the exact code that you are trying to use?
This syntax: # Set $data_file to the location and name of the file in question. my $data_file = '/var/www/cgi-bin/file.txt'; open DATA, ">>$data_file" or die "can't open $data_file $!"; should work for the file(should have write permission ofcourse!). One more thing try puting file.txt into some folder say mydata and then test that. Use Flock, this allows the script to block access to the file while it is opened. So that two users dont alter it at the same time. |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Keep your eyes open | kconnections | Marketing | 6 | 08-02-2006 08:52 PM |
| ExpandReview [OPEN!] | Default. | Marketing | 3 | 01-22-2006 07:41 PM |
| Psd File's | Litepanel | Graphics & Multimedia | 4 | 08-13-2005 09:54 PM |