[Interest] Fwd: QProcess: child read from stdin - no data received?
Till Oliver Knoll
till.oliver.knoll at gmail.com
Mon May 14 09:35:32 CEST 2012
[Forwarding to the proper recipient]
---------- Forwarded message ----------
From: Till Oliver Knoll <till.oliver.knoll at gmail.com>
Date: 2012/5/14
Subject: Re: [Interest] QProcess: child read from stdin - no data received?
To: Thiago Macieira <thiago.macieira at intel.com>
2012/5/13 Thiago Macieira <thiago.macieira at intel.com>:
> On domingo, 13 de maio de 2012 18.36.02, Till Oliver Knoll wrote:
>> this seems to be an ever recurring topic: How does one get notified in a
>> child process (started via QProcess) once there is data to be read on
>> stdin (in a platform-independent matter - but for now mostly OS X)?
>
> There isn't a platform-independent way.
And yet there is a Qt API on the "sender side" (parent process) via
QProcess which seems to provide exactly that. Or how is it different
to listen (in the parent process) for incoming messages on "the other
side of the child process' stdout" than to listen on stdin in the
child process itself?
I mean, one does get the signal readyReadStandardOutput in the parent
proces, once the child process has written to its stdout. So I was
expecting to find the analogon thereof in the child process. But
apparently there is none.
So does the implementation of QProcess on Windows start a thread and
does a blocking read on "the other side of the child process' stdout"?
Or does some QTimer based polling?
Sorry, but it's been quite some time ago since my "Design of the Unix
OS" (dup, dup2, fork, select, ...) lectures, I don't have that book
handy right now, and in the meantime I've been spoilt with high-level
APIs such as Qt anyway ;)
Thanks,
Oliver
More information about the Interest
mailing list