From: "ara.t.howard" Date: 2008-09-27T04:22:41+09:00 Subject: Re: popen3 mysteriously hangs On Sep 26, 2008, at 12:58 PM, James Dinkel wrote: > 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/. > cool. my example was wrong too status, stdout, stderr = systemu command a @ http://codeforpeople.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama