Subject: Re: [SWIPL] wait_for_input

From: Jan Wielemaker <[email-masked]>
Date: Mon, 12 Feb 2001 16:19:17 +0100

On Mon, 12 Feb 2001, Danny Wages wrote:
>
>On windows (version 3.4.4)  wait_for_input on user stream always returns
>immediately as in:
>
>    wait_for_input([user_input],ReadyList,10),  % returns immediately
>    get_single_char(C)   % Blocks waiting for character to be typed
>
>Am I missing something here, or is there a bug?

Close.  wait_for_input/3 is based on the select() call.  In the Unix
version it works on any file-descriptor, in the windows version only
on streams returned by the socket library.

Waiting for user-input in the windows version is not possible in plain
Prolog.  When using the plcon.exe version you could add a foreign
routine to check for available characters on the input.  For plwin.exe
you'll have to do some hacking in the sources for plterm.dll.

I'll update the documentation of wait_for_input/3.

	Sorry --- Jan

>Danny Wages :- Avaya Communication, 303-538-3972, [email-masked]