Hi,

At Wed, 11 Sep 2002 22:36:44 +0900,
Khurram wrote:
> > >  .getc can be used to read characters (1 byte) at a time.  Is there
> > > anything that will read a word or dword at a time?
> > 
> > What about sysread with the appropriate byte count as an argument?
> > 
> > Hope this helps,
> > 
> > Mike
> 
> The sysread returns a string... I want the actual binary value.
> 
> Is there a way to do this conversion?

If you mean 2 byte data by "word" and 4 byte data by "dword",

class IO
  def getword
    read(2).unpack("s").first
  end
  def getdword
    read(4).unpack("l").first
  end
end

-- 
Nobu Nakada