[fpc-pascal] Re: TFileStream and stdin - how to make this work?

Bernd Kreuss prof7bit at googlemail.com
Sun Oct 3 23:52:55 CEST 2010


On 03.10.2010 19:10, Seth Grover wrote:
> Could you use THandleStream
> (http://www.freepascal.org/docs-html/rtl/classes/thandlestream.html)?
> 
> myInputStream := THandleStream.Create(StdInputHandle);

Yea, this looks like what TIOStream internally seems to do. I have now
worked around the blocking issue by simply reading from the stream in a
separate thread.

I almost found the above myself (found something similar with google)
but I couldn't remember the name of the StdInputHandle constant i only
found a windows only example with something like STD_INPUT_HANDLE while
I was sitting on my Linux laptop at that moment.

(the final application will run on windows but i was doing some initial
experiments with TProcess and stdio while sitting at my linux machine)

Bernd



More information about the fpc-pascal mailing list