|
|
AppleScript CGI Errors...
|
|
|
|
Addicted to MacNN
Join Date: Jan 2000
Location: Stoneham, MA, USA
Status:
Offline
|
|
I'm running an AppleScript as a CGI in personal web sharing on 8.1. Now when the call for the following subroutine is commented out, the cgi runs no prob. When it is left in there, the CGI does not run, and it gives errors like bad gateway, sometimes it just times out. Its very odd. So here is the problem code, can anybody see the problem, it looks perfect to me, I can't find one problem. Also, is there something 'special' you have to know about running AppleScript's as CGI's in classic? I've never had any troubles before, but that could have been luck I suppose.
Here is the questionable subroutine...
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Feb 2000
Location: Nashua NH, USA
Status:
Offline
|
|
Originally posted by l008com:
<STRONG>I'm running an AppleScript as a CGI in personal web sharing on 8.1. Now when the call for the following subroutine is commented out, the cgi runs no prob. When it is left in there, the CGI does not run, and it gives errors like bad gateway, sometimes it just times out. Its very odd. So here is the problem code, can anybody see the problem, it looks perfect to me, I can't find one problem. Also, is there something 'special' you have to know about running AppleScript's as CGI's in classic? I've never had any troubles before, but that could have been luck I suppose.
Here is the questionable subroutine...
</STRONG>
I use the alias when you read and write to the file not the result of the open for access command
set specialile to alias "______________"
set specialfile_ref_num to open for access specialfile with write permission
then ignore specialfileref
|
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Jan 2000
Location: Stoneham, MA, USA
Status:
Offline
|
|
According to the reference, the result returned from the open command is a file reference number than can be used as the 'object' of all the read, write and oef commands... Since I have no other ideas though, i'm going to try it manually anyway and see if it works....
|
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Jan 2000
Location: Stoneham, MA, USA
Status:
Offline
|
|
OK I tried it with all the specialfile's written out with the full pathname, and it still gave a 502 error, both ways should work, so the problem must be something else.
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Feb 2000
Location: Nashua NH, USA
Status:
Offline
|
|
My only other suggestions would be a try block to see what the error is. That or there is the trick for debugging release code were you put in dialog boxes in to find out where the error is by which was last before the crash.
|
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Jan 2000
Location: Stoneham, MA, USA
Status:
Offline
|
|
i tried the Try error handler and having it display the error, adn much to my surprise, the script itself never got an error. The dialog debugging idea is good, but i'd use simple 'beep's and count them, which I actually did at one point, but for the sake of me figuring this out, jsut forget I even said that, maybe i'll try it again later.
|
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Jan 2000
Location: Stoneham, MA, USA
Status:
Offline
|
|
OK I've made a little headway...
Now after really dissecting this thing, it seems to have trouble, but not get an error, on the 'read' line Now when I think back to the first time I write this same script and had it running, I think I set it up a little differently, and didn't use 'read' from file at all. Is there something special about the read function, something you have to do to get it to work? Or something specifically you have to do to get it to work when in a CGI?
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Feb 2000
Location: Nashua NH, USA
Status:
Offline
|
|
I haven't done any coding of CGI's just normal applescript stuff. The only thing i can see about the read line that could be the problem is the assumption of length of the file. If it isn't long enough then you could get an non result from the read operation.
|
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Jan 2000
Location: Stoneham, MA, USA
Status:
Offline
|
|
The file in question is a specific log file that IS longer, and 438 is a specific spot in that file where I wanna insert new data. Similar applescripts work fine as regular apps, its just when I run them as CGI's they don't work.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|