From: Jeremy Bopp Date: 2012-06-29T00:01:31+09:00 Subject: Re: Asynchronous IO On 06/28/2012 09:12 AM, F1 dreamer wrote: > Currently I'm using OI.popen to open a new pipe to another process, and > I feed commands to it; but sometimes the other process could run for > multiple minutes before closing the pipe; and only at that stage can I > then see the output. Now, what I really need is to see the output of the > process as it writes to stdout already and not only when closing the > pipe? The problem you're probably facing is due to the program being run via popen buffering its output. This is pretty normal when the program is outputting to a pipe, as it does when run via popen. This page has a reasonable summary of things: http://blog.habets.pp.se/2008/06/Buffering-in-pipes Unless the program you're trying to run has some specific options available to force it to disable buffering, you're probably going to be forced to write your own sort of popen method that allocates a pty rather than a pipe for interaction with the program. -Jeremy