[fpc-devel] TProcess.NumBytesAvailable
Vincent Snijders
vsnijders at quicknet.nl
Wed Jan 31 16:57:03 CET 2007
Vincent Snijders schreef:
> Marc Weustink schreef:
>> Vincent Snijders wrote:
>>> Hi,
>>>
>>> TAsyncProcess from the LCL has a property NumBytesAvailable. Attached
>>> patch adds it to TProcess in the FCL.
>>>
>>> NumBytesAvailable checks how many bytes are available in
>>> TProcess.Output, so you can decide not to read from it if there are
>>> no bytes available.
>>
>> What about StdErr output ?
>>
>> Cant this be a property of the TInputPipeStream ?
>>
>>
>
> Seems like an good idea. I will create a new patch.
>
> Jonas Maebe schreef:
> >
> > The FIONREAD constant is available in the termio units of both Darwin
> > and FreeBSD as of 2.0.4 (not for Open/NetBSD, but that's probably the
> > least of the things which need to be changed to get those platforms
> > going again).
>
> Thanks for the hint. I guess this was not yet the case when
> TAsyncProcess was written by Micha.
Attached is a new patch.
I didn't how to implement this for OS/2.
If the CreatePipes function was not implemented, I assume that poUsePipes cannot be
used. GetNumBytesAvailable returns 0 is such cases.
Vincent
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: numbytesavailable.patch
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20070131/e22fc070/attachment.ksh>
More information about the fpc-devel
mailing list