[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: popen read and write?
- From: "steve donovan" <steve.j.donovan@...>
- Date: Thu, 11 Oct 2007 09:25:22 +0200
On 10/11/07, Edgar Toernig <email@example.com> wrote:
> I.e. glib's popen2 (with that looong name) looks like a solid
> base. Together with its io-queues and the select-based main
> loop you have everything to get deadlock-free bidirectional
This is probably the only way one can do this and be completely safe.
One could make popen2 return a third value which is a control object,
but this is useless if you're blocking in stdio anyway.
I've used the GTK stuff successfully in a SciTE extension, and also
worked out the Windows equivalent: you spawn the process in a new
thread, and use SendMessage to post output back to the GUI thread. I
can provide code if anybody is interested.