Subject: RE: [SWIPL] eof_action of current input stream

From: "Douglas R. Miles" <[email-masked]>
Date: Fri, 22 Jun 2001 01:00:35 -0700

Michael,

On this thread..

I am interested in using SWI under Windows 2000 Webserver (IIS 5) .. 

There are two methods I am using right now but am interested in hearing your
approach. 

Did you use ASAPI Filters or another method?

Douglas

> -----Original Message-----
> From: Jan Wielemaker [mailto:[email-masked]]
> Sent: Thursday, June 07, 2001 1:26 PM
> To: Michael A. Covington; [email-masked]
> Subject: Re: [SWIPL] eof_action of current input stream
> 
> 
> > OK, another question relating to CGI scripting.
> > 
> > I've got SWI Prolog 4.05 running as a CGI script engine 
> under Windows 2000's
> > web server.  So far so good.
> > 
> > Now I'm trying to get input into it using the POST method 
> (i.e., standard
> > input).
> > 
> > Windows sends it a string that does not end with an 
> end-of-line mark.
> 
> No, but as far as I know, CGI's are passed the environment variable
> CONTENT_LENGTH, indicating the number of bytes you must read from the
> standard input.
> 
> I've just extended set_stream/2 to allow controlling the buffering
> of open streams, but it appears it would be a good idea to add some
> more (binary/text mode, eof_action).
> 
> > And the eof_action for console input is eof_action(reset), 
> so I can't detect
> > the end-of-file condition -- instead, SWI Prolog waits 
> forever for more
> > characters to be typed.
> 
> You can still detect the end-of-file, as it returns -1.  
> 
> 	--- Jan
> 
> P.s.	The libc package contains cgi.c.  In my internal release I've
> 	added this to the standard suite for Windows too (it was already
> 	in the Unix version).  If you want I can send you the DLL (it
> 	hasn't really been tested on Windows I'm afraid).
> 
> 
> ----------------
> * To UNSUBSCRIBE, please use the HTML form at
> 
>     
> http://www.swi.psy.uva.nl/projects/SWI-Prolog/index.html#mailinglist
> 
> or send mail to [email-masked] using the 
> Subject: "unsubscribe"
> (without the quotes) and *no* message body.
> 
> ** An ARCHIVE of this list is maintained at
> 
>     http://www.swi.psy.uva.nl/projects/SWI-Prolog/mailinglist/archive/
> 
> 
>