On Wed, 1 Feb 2017 05:02:05 -0700 (MST) fredvs <fi...@hotmail.com> wrote:
> Hello. > > I have done lot of search on internet about pipes without success. > Even for Delphi. no demo nor explanation. > The same in fpc wki page. > > For example, how to use bytesavailable with pipes ? http://wiki.freepascal.org/Executing_External_Programs#How_to_redirect_output_with_TProcess > In: > CreatePipeHandles(InHandle, OutHandle, APipeBufferSize); > > InPipe.Read(Bufferout[0],BPipeBufferSize); > > What is the the ratio with APipeBufferSize vs BPipeBufferSize ? APipeBufferSize is how much the other process can produce before congestion. BPipeBufferSize is how much you want to process/eat each iteration. Usually APipeBufferSize >= BPipeBufferSize. > And length of Bufferout[0] vs APipeBufferSize vs BPipeBufferSize ? Bufferout[0] is just the first value. The whole Bufferout can be written by InPipe.Read. Therefore Bufferout must be >= BPipeBufferSize. > In short, a demo will be welcome. Mattias _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal