[fpc-devel] TProcess.NumBytesAvailable
Michael Van Canneyt
michael.vancanneyt at wisa.be
Wed Jan 31 17:28:34 CET 2007
On Wed, 31 Jan 2007, Vincent Snijders wrote:
> 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.
Patch applied. Revision 6275.
Michael.
More information about the fpc-devel
mailing list