From: Gary Hasson Date: 2009-11-29T09:25:26+09:00 Subject: Re: Ruby byte access to disk sectors like dd does Thank you all for your guidance. I am now able to do with Ruby what I previously need dd for. However, I am not able to cleanly test for the end of file due to the following error: until file_1.eof? file_1_byte = file_1.sysread( 1 ) end ERROR MSG: ./Ruby_file_test.rb:23:in `sysread': sysread for buffered IO (IOError) from ./Ruby_file_test.rb:23 All of my file accesses are sysread, syswrite, and sysseek, which are not compatible with IO#eof. Using the file size to prevent hitting the EOF does not work for /dev/sdb. So, I just let it generate an EOF error and then rescue it. It seems like there ought to be a working EOF function for IO#sys... Gary -- Posted via http://www.ruby-forum.com/.