From: "ara.t.howard" Date: 2008-06-01T08:26:38+09:00 Subject: Re: getting standard error and output from ruby script in real time On May 31, 2008, at 10:16 AM, Stefano Crocco wrote: > > I don't think that would work. If I understand correctly what you > mean, that > should be put in the script which produces the output, not not in > the one > displaying it. But since the output I want to display is from a > script written > by the user, I can't do that. what you want to do is easily accomplished using session.rb http://codeforpeople.com/lib/ruby/session/session-2.4.0/README gem install session note that i wrote to do *exactly* what you are doing - but it was for a tk gui. anyhow, you *must* do this in a background thread as there are certain things child programs can do (like setvbuf) which can defeat any counter buffering techniques you may try - so you must always process the stdout/stderr asynchronously in a background thread which updates the gui. session makes this trivial to accomplish. kind regards. 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