From: Bill Kelly Date: 2009-11-27T12:28:23+09:00 Subject: Re: Ruby byte access to disk sectors like dd does From: "Gary Hasson" > > I have been unable to find any reference to Ruby methods that provide > raw disk access the way dd does. I frequently use the Linux utility > program, dd, and would like to be able to do the same type of byte-level > and sector-level access to the hard drive with Ruby. (What I am looking > for is not file access.) Are there Ruby methods to provide this > capability (other than having Ruby access dd)? [i think my previous post didn't make it to the list] dd if=/dev/hdb bs=512 count=1 | hexdump -C ...should be equivalent to... ruby -e 'File.open("/dev/hdb", "rb") {|io| print(io.read(512))}' | hexdump -C Regards, Bill