Re: [Harbour] syscmd

2009-06-17 Thread Davor Siklic
Przemyslaw Czerpak napsal(a): Nice but it will not work as expected in all cases. If stderr output is longer then PIPE buffer size this code will create deadlock. If if passed stdin is longer then PIPE buffer size then is truncated in hidden. This deadlock in this code can be used to exploit in t

Re: [Harbour] syscmd

2009-06-16 Thread Viktor Szakáts
On 2009.06.16., at 22:46, Przemyslaw Czerpak wrote: On Tue, 16 Jun 2009, Szak�ts Viktor wrote: Thanks Davor. Here's a slightly tweaked version: --- #include "common.ch" #include "fileio.ch" FUNCTION hb_processRun( cCommand, cStdIn, cStdOut, cStdErr ) LOCAL hProcess LOCAL hStdIn, hStdOut,

Re: [Harbour] syscmd

2009-06-16 Thread Przemyslaw Czerpak
On Tue, 16 Jun 2009, Szak�ts Viktor wrote: > Thanks Davor. > Here's a slightly tweaked version: > --- > #include "common.ch" > #include "fileio.ch" > > FUNCTION hb_processRun( cCommand, cStdIn, cStdOut, cStdErr ) >LOCAL hProcess >LOCAL hStdIn, hStdOut, hStdErr >LOCAL nErrorLevel >h

Re: [Harbour] syscmd

2009-06-16 Thread Davor Siklic
Viktor Szakáts napsal(a): Thanks Davor. Here's a slightly tweaked version: Great Note, that I don't make a much tests, but seem to work as expected, only I have no idea what function return in nErrorLevel. In case that all is ok, expected behavior is that 0 be returned, but function return -2

Re: [Harbour] syscmd

2009-06-16 Thread Viktor Szakáts
Thanks Davor. Here's a slightly tweaked version: --- #include "common.ch" #include "fileio.ch" FUNCTION hb_processRun( cCommand, cStdIn, cStdOut, cStdErr ) LOCAL hProcess LOCAL hStdIn, hStdOut, hStdErr LOCAL nErrorLevel hProcess := hb_processOpen( cCommand, @hStdIn, @hStdOut, @hStdEr

[Harbour] syscmd

2009-06-16 Thread Davor Siklic
Hi all I need to have run command with standard input, std. output and error output which I use in past. After discover found hb_process* functions and find that are little difficult to use. Attached is syscmd.prg and is good example of using hb_process* functions. I get inspired with uhttpd