On Tue, 29 Jan 2002 08:15:05 +1100, Paul Brannan wrote:

> On Tue, Jan 29, 2002 at 04:01:09AM +0900, nobu.nokada / softhome.net
> wrote:
>> Since pipe isn't a tty, libc buffers STDOUT by default.
> 
> So a call to setvbuf ought to solve the problem...
> 
> but this is only done on open or clone to make the FILE object fully
> buffered.  It seems there is no way to change this from Ruby... or am I
> wrong here?

You should be able to use

   stdout.sync = true

to cause the buffering to disappear altogether.  I don't know that
there's an option to explicitly buffer a line at a time, though.