From: James Dinkel Date: 2008-09-27T03:58:59+09:00 Subject: Re: popen3 mysteriously hangs Ara Howard wrote: > > you are clogging the buffer with stdout and so the child process goes > to sleep. you have to use some caution getting both stdout and stderr > from a child process because a full buffer for either will block the > child. probably the simplest way to do what you want is > > gem install systemu > > > stdout, stderr, status = systemu command > > > this also works on windows if you need to handle the output in > realtime try using open4 (gem install open4) as it abstracts that > threaded reading for you. > I don't need realtime output, I just need the output when it's all done. Is there any way to flush stdout and stderr while the program is running? I really only need the last 50 lines or so of stdout and only the very last line of stderr. I'll have a look at systemu, too. Thanks. -- Posted via http://www.ruby-forum.com/.