[Qt-interest] Coordinating stderr between processes in a pipe train
Jeffrey Brendecke
jwbrendecke at icanetix.com
Tue Jul 14 15:40:46 CEST 2009
Thanks for your reply.
StdOut is not the problem here: It is being dealt with separately (dumped to
NUL: in this case).
The problem is that the stderr output from each component app in the pipe
train is stomping on each other.
However, I think you are right that buffering may be playing a role here.
I tried specifically opening stderr through a QFile with the option
QIODevice::WriteOnly. However, the results are the same.
Is there a way to open stderr for write with buffering in a cross-platform
compatible manner? I see an option QIODevice::Unbuffered but no "Buffered"
counterpart.
---------
On Tuesday 14 July 2009 14:57:59 Martin Gebert wrote:
> > Given the above commandline, sometimes everything looks OK
> > (the order is not
> > important for my purposes):
> >
> > xx 0
> > cc 0
> > ERROR 0
> > dd 0
> >
> > Other times, it gets garbled (it can get much worse than this):
> >
> > cxc 0
> > Ex 0
> > RROR 0
> > dd 0
>
> Usually stdout is buffered, delaying the output for an unspecified, short
> time, while stderr is unbuffered in order to display messages immediately.
> Thus I can imagine that in some cases the writing routines of stdout are
> interrupted by stderr, showing the results above. If you want both streams
> be serialized you should think about redirecting one to the other (resp.
> use one of them for both out and err).
>
> Martin
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
More information about the Qt-interest-old
mailing list