From: Heesob Park Date: 2008-08-29T10:37:15+09:00 Subject: Re: Unraveling binary data out of the proc filesystem on Solaris 2008/8/26 Daniel Berger : > > > On Aug 25, 7:59 pm, "Heesob Park" wrote: >> Hi, >> >> 2008/8/26 Daniel Berger : >> > >> I guess you should use lseek and read combination. > > Ruby has no lseek that I'm aware of. I tried an open + seek + read > approach, but I get the same result. > Are you unaware IO#sysseek ? sysseek is actualy lseek. ------------------------------------------------------------- IO#sysseek ios.sysseek(offset, whence=SEEK_SET) => integer ------------------------------------------------------------------------ Seeks to a given _offset_ in the stream according to the value of _whence_ (see +IO#seek+ for values of _whence_). Returns the new offset into the file. f = File.new("testfile") f.sysseek(-13, IO::SEEK_END) #=> 53 f.sysread(10) #=> "And so on." I guess open + sysseek +sysread will work for you. Regards, Park Heesob