Monday, November 29, 2010

Ruby Autoflush

Google seems to need help with this particular association, so here goes.

In Ruby, to flush currently buffered data just once, call flush on the handle in question:
STDOUT.flush
To "autoflush", or continuously flush output immediately, set the sync attribute:
STDOUT.sync = true
References: flush, sync

1 comment: