From: Matt Triviski Date: 2010-07-22T09:56:00+09:00 Subject: Re: Writing to file delay Joel VanderWerf wrote: > Eric Wong wrote: >>> Redhat 5) is waiting until it gets a block of data before it actually >> "file.sync = true" looks good already. > You could try calling fsync as well (it's not a writer, just call > "file.fsync"): > > Implementation from IO > ------------------------------------------------------------------------------ > ios.fsync -> 0 or nil > > ------------------------------------------------------------------------------ > > Immediately writes all buffered data in ios to disk. Note that > fsync differs from using IO#sync=. The latter ensures that data > is flushed from Ruby's buffers, but doesn't not guarantee that the > underlying > operating system actually writes it to disk. > > NotImplementedError is raised if the underlying operating system does > not support fsync(2). Hey fellas, thanks for the response. I tried file.fsync, and checked to make sure that the return was not nil, and it wasn't. However, I am seeing the same activity. I took out the select call and as Eric suggested and just used "file.write(server.socket.readpartial(8k))" with and that did not seem to help either. I am writing to NFS, so I am thinking that this may be the issue. I'm starting to think that there is no way for me to get what I want, except to rewrite this in C or Assembly :( -- Posted via http://www.ruby-forum.com/.