Re: [fpc-pascal] TProcess usage and reading program output

2017-02-28 Thread Benito van der Zander
Hi, how would you handle large output and large stderr? When you read from one and it writes to the other, the read blocks. Then it keeps writing to the other buffer, till that is full, and then its write is blocked, and it is deadlocked. Probably check NumBytesAvailable before reading?

Re: [fpc-pascal] TProcess usage and reading program output

2017-02-28 Thread Graeme Geldenhuys
On 2017-02-28 20:03, nore...@z505.com wrote: > Did you end up resolving the issue? Yes, see my "closing thoughts" reply to Michael. What he suggested fixed the issue. > I'd be interested in creating a build tool that not only compiles > projects in FPC but also compiles with dcc32 (delphi

Re: [fpc-pascal] TProcess usage and reading program output

2017-02-28 Thread Graeme Geldenhuys
On 2017-02-28 16:28, Michael Van Canneyt wrote: > poWaitOnExit should not be needed, as this will cause Execute to wait for > process exit... This post is simply to close off this thread. Michael's suggestion was the solution to my problem. I removed the poWaitOnExit and set my buffer size to

Re: [fpc-pascal] TProcess usage and reading program output

2017-02-28 Thread noreply
On 2017-02-28 10:06, Graeme Geldenhuys wrote: Hi, Can anybody see if there is something wrong with the code shown below. The code is copied from one of my earlier projects where I call the FPC compiler and it worked just fine in that project. Did you end up resolving the issue? I'd be

Re: [fpc-pascal] TProcess usage and reading program output

2017-02-28 Thread Graeme Geldenhuys
On 2017-02-28 16:28, Michael Van Canneyt wrote: > poWaitOnExit should not be needed, as this will cause Execute to wait for > process exit... > > It seems likely that this will interfere with reading from output: when the > output buffer is full, the executed process will block. Ah. I've also

Re: [fpc-pascal] TProcess usage and reading program output

2017-02-28 Thread Michael Van Canneyt
On Tue, 28 Feb 2017, Graeme Geldenhuys wrote: Hi, Can anybody see if there is something wrong with the code shown below. The code is copied from one of my earlier projects where I call the FPC compiler and it worked just fine in that project. In the work I'm doing now, I'm calling the

Re: [fpc-pascal] TProcess usage and reading program output

2017-02-28 Thread Graeme Geldenhuys
On 2017-02-28 16:06, Graeme Geldenhuys wrote: > //p.CurrentDirectory := ExtractFilePath(p.Executable); Just thought I would explain this. I don't change directory there (in the TProcess instance), because the program itself changes the current directory before calling RunTProcess(). As for

[fpc-pascal] TProcess usage and reading program output

2017-02-28 Thread Graeme Geldenhuys
Hi, Can anybody see if there is something wrong with the code shown below. The code is copied from one of my earlier projects where I call the FPC compiler and it worked just fine in that project. In the work I'm doing now, I'm calling the Delphi Command Line Compiler, and made a few minor