public Method

IO.readchar

ios.readchar    fixnum

Reads a character as with IO#getc, but raises an EOFError on end of file.

Source Code

/*
*  call-seq:
*     ios.readchar   => fixnum
*  
*  Reads a character as with <code>IO#getc</code>, but raises an
*  <code>EOFError</code> on end of file.
*/

static VALUE
rb_io_readchar(io)
   VALUE io;
{
   VALUE c = rb_io_getc(io);

   if (NIL_P(c)) {
       rb_eof_error();
   }
   return c;
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.