From jan@swi.psy.uva.nl Mon Feb 12 16:25:28 2001
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.152.30])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f1CFPSZ11318;
	Mon, 12 Feb 2001 16:25:28 +0100 (MET)
Received: from localhost (localhost [[UNIX: localhost]])
	by gollem.swi.psy.uva.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id QAA23032;
	Mon, 12 Feb 2001 16:25:27 +0100
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Organization: SWI, University of Amsterdam
To: <dwages@Avaya.com>, "Danny Wages" <dwages@Avaya.com>,
   prolog@swi.psy.uva.nl
Subject: Re: [SWIPL] wait_for_input
Date: Mon, 12 Feb 2001 16:19:17 +0100
X-Mailer: KMail [version 1.0.28]
Content-Type: text/plain
References: <000101c09504$c504ae40$03270987@COF110DWAGES>
In-Reply-To: <000101c09504$c504ae40$03270987@COF110DWAGES>
MIME-Version: 1.0
Message-Id: <01021216252705.17077@gollem>
Content-Transfer-Encoding: 8bit

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, dwages@Avaya.com

