Understanding Ruby and OS I/O buffering
How does IO buffering work in Ruby? How often is data flushed to the underlying stream when using the IO and File classes? How does this compare to OS buffering? What needs to be done to guarantee that given data has been written to disk, before confidently reading it back for processing? Casper The Ruby IO documentation is not 100% clear on how this buffering works, but this is what you can extract from the documentation: Ruby IO has its own internal buffer In addition to that the underlying operating system may or may not further buffer data. The relevant methods to look at: IO.flush :