> hmm. Actually I wanted to write CGI scripts, interpreted by Hugs. Is
> this Socket.hi only a lib for GHC? I mean is there anything simular for
> Hugs? I would prefer to develop my CGI's with Hugs (for I don't have GHC
> on my system) and run them as scripts.

OK, the `cheat' way to do it would involve using the shell... simply do 
something like:

import System
import Directory

main = do system "lynx -source http://www.haskell.org > tempfile.html"
          s <- getContents "tempfile.html"

(untested!)

(this assumes you have lynx installed on your system; wget is another 
program with this functionality (and much more); or you could write a 
short C program to do it).

In reality, you should generate a fresh random name for the file each 
time to avoid conflicts, and you should clean up after yourself (use 
`system "/bin/rm foo"') if Directory.removeFile doesn't work).

HTH.

--KW 8-)
-- 
Keith Wansbrough <[EMAIL PROTECTED]>
http://www.cl.cam.ac.uk/users/kw217/
Cambridge University Computer Laboratory.


Reply via email to