On Thu, Jan 26, 2017 at 8:20 PM, fredvs <fi...@hotmail.com> wrote: > Hello. > > Some news from the front: > > var > BufferURL : array of float; > > ..... > > PipeBufferSize := $4000 ; > > CreatePipeHandles(InHandle, OutHandle, PipeBufferSize); > > InPipe := TInputPipeStream.Create(InHandle); > OutPipe := TOutputPipeStream.Create(OutHandle); > httpget := TThreadHttpGetter.Create(opus_url,OutPipe); > > setlength(BufferURL, PipeBufferSize); > > // This to have the buffer as parameter ??? > InPipe.Read(BufferURL,PipeBufferSize); > > op_test_memory(BufferURL,PipeBufferSize, Err); > > => Gives as error: -133 => > A required header packet was not properly formatted, contained illegal > values, or was missing altogether. > > So it seems that the buffer was accepted, only miss the header ? > > Difficult to explore when there is no documentation how to do nor examples. >
I had never tried pipes before, but it seems FPC has a unit to handle that: `iostream`, so today I played a very simple test: program project1; uses sysutils, iostream; const buf_sz = 1024; var buf: tbytes; sz: longint; stdin: tiostream; begin stdin := tiostream.create(iosinput); try setlength(buf, buf_sz); // it is just a test, so I limited it to 1024 bytes, please read the entire content by yourself! :-) sz := stdin.read(buf[0], buf_sz); if sz < buf_sz then setlength(buf, sz); writeln(tencoding.utf8.getstring(buf)); finally stdin.free; end; end. in my terminal: $ echo "Yes" | ./project1 Yes However, I don't know if you are searching exactly that, anyway you can check the iosinput sources. :-) Any idea is highly welcome. > > Fe;D > > ----- > Many thanks ;-) -- Silvio Clécio
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal