rev cgi - put url & read from
sims at ezpzapps.com
Sun Sep 21 01:22:11 CDT 2008
For clarity and for those who use the archives a lot...
Dave Cragg sent:
> But I've never come across a case of open-read-close working where
> get/put url didn't. What kind of error do you see in the result? Are
> the file paths identical in both cases?
"...libUrl only handles url commands for internet urls (http, ftp).
The engine handles the file protocol urls directly."
> there's no libURL in the CGI engines, did you copied libURL yourself
> to your CGI? If you didn't then you can't use url calls.
I am making a Rev cgi stack which signs up people (name, email, ID
number, etc.) to a text
file on the server itself. The script gets a list from text file,
checks to see if the person is
already on it, makes sure the admin is not over their limit number of
users, adds new, and then proceeds.
So, I needed to put the contents of that text file into a variable.
As I live in the List Archives & also in the Dictionary, I did glance
at the Dictionary. Seeing the
"not on a server" bit plus the "include this custom library" bit I
figured that I would simply
move back to my old SuperCard method of open-read-close.
Then I stumbled about until I happened upon the correct file path ;-)
After reading the words of the most honorable Dave, I went back to
check on this.
I tried (now being certain of the file path): put url "file:Roma/
visitors.txt" into tUserList
Dang thing worked. :-)
---------- From the Dictionary --------
file: a text file on the local disk (not on a server)
binfile: a binary file
resfile: on Mac OS and OS X systems, the resource fork of a file
All actions that refer to a URL container are blocking: that is, the
handler pauses until Revolution is finished accessing the URL. Since
fetching a web page may take some time due to network lag, accessing
URLs may take long enough to be noticeable to the user. To avoid this
delay, use the load command (which is non-blocking) to cache web pages
before you need them.
Important! The http and ftp keywords are part of the Internet
library. To ensure that these URL types work in a standalone
application, you must include this custom library when you create your
standalone. In the Inclusions section of the Standalone Application
Settings window, make sure "Internet Library" is selected in the list
of script libraries.
More information about the use-livecode