[fpc-pascal] Re: fpc-pascal Digest, Vol 71, Issue 50

Henry Vermaak henry.vermaak at gmail.com
Thu May 20 13:42:03 CEST 2010

On 20 May 2010 10:28, Hartmut Eilers <hartmut at eilers.net> wrote:
> Hallo Henry,
> thank you for your fast response.
> Sorry to say, that I don't understand what you suggest.
> Could you explain it a bit more ?

SelectText monitors a file descriptor for input (or output) to become
ready for up to the timeout you specify.  You can probably get the
same effect on win32 by opening the file specifying an overlapped
structure, which will enable you to do async i/o.  The a call to
readfile will return immediately, at which point you can call
WaitForSingleObject with a timeout.  You can check the result to see
if anything was read during the timeout specified.

More info here:


If you have other calls to select (on file descriptors), you might
want to consider using something like libevent, which solves these
things in a cross platform way.  Or if you're brave you can look at
cygwin's implementation of select (
http://www.cygwin.com/cygwin-ug-net/highlights.html#ov-hi-select ).


More information about the fpc-pascal mailing list