method

readbyte

Importance_1
v1_9_2_180 - Show latest stable - 0 notes - Class: ARGF
readbyte() public

Reads the next 8-bit byte from ARGF and returns it as a Fixnum. Raises an EOFError after the last byte of the last file has been read.

For example:

$ echo "foo" > file
$ ruby argf.rb file

ARGF.readbyte  #=> 102
ARGF.readbyte  #=> 111
ARGF.readbyte  #=> 111
ARGF.readbyte  #=> 10
ARGF.readbyte  #=> end of file reached (EOFError)
Show source
Register or log in to add new notes.