akiross
29th April 2013, 10:42
Hello,
I would like to pipe together multiple processes, so that one or more produces the data and the others read.
I tried using QByteArray, as a buffer, but it's a bit tricky, because of the order in which processes starts and close. So I thought to use another QIODevice, like QBuffer, but I cannot find anything to feed a QIODevice as process stdin/out - but only setStandard(Input|Output|Error)File, which works with QStrings for actual paths.
I am seeking for a simple mechanism, where a the output processes are given one output file as a buffer, and this file is passed as input to the others.
What do you think is the best way to proceed?
Thanks!
EDIT:
Also, consider I need to push some generated data to the input processes before they actually start.
The tricky point is how to tell listening processes that input is finished, and therefore the input channel of receiving processes has to be closed correctly when ALL the producing processes (and my data source) have finished. I was thinking to something like a EOF sequence, but I do not think Qt works like that.
I would like to pipe together multiple processes, so that one or more produces the data and the others read.
I tried using QByteArray, as a buffer, but it's a bit tricky, because of the order in which processes starts and close. So I thought to use another QIODevice, like QBuffer, but I cannot find anything to feed a QIODevice as process stdin/out - but only setStandard(Input|Output|Error)File, which works with QStrings for actual paths.
I am seeking for a simple mechanism, where a the output processes are given one output file as a buffer, and this file is passed as input to the others.
What do you think is the best way to proceed?
Thanks!
EDIT:
Also, consider I need to push some generated data to the input processes before they actually start.
The tricky point is how to tell listening processes that input is finished, and therefore the input channel of receiving processes has to be closed correctly when ALL the producing processes (and my data source) have finished. I was thinking to something like a EOF sequence, but I do not think Qt works like that.