Can't retrieve a text file from a remote CGI folder

Dave Cragg dave.cragg at lacscentre.co.uk
Wed Apr 10 19:48:40 EDT 2013


On 11 Apr 2013, at 00:17, J. Landman Gay <jacque at hyperactivesw.com> wrote:

> Wrapping up my recent move to a different 32-bit server, there's one issue left. Linux gurus, can you help?
> 
> CGI text-based scripts are now working correctly except for an issue I can't identify. When writing to a log file, a server 500 error occurs immediately after the write. Here's a test script:
> 
> #!rev -ui
> 
> on startup
>  open file "log.txt" for append
>  write "this is a test" & cr to file "log.txt"
>  close file "log.txt"
>  put "Content-Type: text/plain" & cr
>  put "done writing"
> end startup
> 
> When called from a browser, the entry is written to the log file and a 500 error is reported. "done writing" never appears.


Does it make a difference if you put another cr after the header? 

on startup
 open file "log.txt" for append
 write "this is a test" & cr to file "log.txt"
 close file "log.txt"
 put "Content-Type: text/plain" & cr
 put cr
 put "done writing"
end startup

Dave






More information about the use-livecode mailing list