From: Paul Brannan Date: 2002-02-22T06:41:21+09:00 Subject: Re: Now I'm really confused! On Fri, Feb 22, 2002 at 05:52:23AM +0900, Chris Gehlker wrote: > Here I go answering my own question. I'm doing this for the sake of the > archive. It turns out that there are two solutions, at least. > > The easy one is to prepend > $stdout.sync= true > To the program in the IDE's source window. > > The hard way is to use setvbuf() from C. I say that its the hard way because > it would require me to drop out of the high level cocoa API and write a lot > of RubyStudio in straight C. > > There may be another way using BSD file descriptors. I'm going to go look > that up. I've struggled with a similar problem myself [ruby-talk:32646]. In C, stdout is fully buffered iff it does not point to an interactive device (otherwise it is line buffered or not buffered at all, though most platforms make it line buffered). Ruby does not appear to call setvbuf() on stdout, stderr, or stdin (though it does for most other IO objects). Do you think perhaps that it should? Paul