Extended maintenance of Ruby 1.9.3 ended on February 23, 2015. Read more

In Files

  • stringio/stringio.c

Class/Module Index [+]

Quicksearch

IO::readable

Public Instance Methods

sysread(integer[, outbuf]) → string click to toggle source

Similar to read, but raises EOFError at end of string instead of returning nil, as well as IO#sysread does.

 
               static VALUE
strio_sysread(int argc, VALUE *argv, VALUE self)
{
    VALUE val = rb_funcall2(self, rb_intern("read"), argc, argv);
    if (NIL_P(val)) {
        rb_eof_error();
    }
    return val;
}
            
readbyte → fixnum click to toggle source

See IO#readbyte.

 
               static VALUE
strio_readbyte(VALUE self)
{
    VALUE c = rb_funcall2(self, rb_intern("getbyte"), 0, 0);
    if (NIL_P(c)) rb_eof_error();
    return c;
}
            
readchar → string click to toggle source

See IO#readchar.

 
               static VALUE
strio_readchar(VALUE self)
{
    VALUE c = rb_funcall2(self, rb_intern("getc"), 0, 0);
    if (NIL_P(c)) rb_eof_error();
    return c;
}
            
readline(sep=$/) → string click to toggle source
readline(limit) → string or nil
readline(sep, limit) → string or nil

See IO#readline.

 
               static VALUE
strio_readline(int argc, VALUE *argv, VALUE self)
{
    VALUE line = rb_funcall2(self, rb_intern("gets"), argc, argv);
    if (NIL_P(line)) rb_eof_error();
    return line;
}
            
sysread(integer[, outbuf]) → string click to toggle source

Similar to read, but raises EOFError at end of string instead of returning nil, as well as IO#sysread does.

 
               static VALUE
strio_sysread(int argc, VALUE *argv, VALUE self)
{
    VALUE val = rb_funcall2(self, rb_intern("read"), argc, argv);
    if (NIL_P(val)) {
        rb_eof_error();
    }
    return val;
}
            
sysread(integer[, outbuf]) → string click to toggle source

Similar to read, but raises EOFError at end of string instead of returning nil, as well as IO#sysread does.

 
               static VALUE
strio_sysread(int argc, VALUE *argv, VALUE self)
{
    VALUE val = rb_funcall2(self, rb_intern("read"), argc, argv);
    if (NIL_P(val)) {
        rb_eof_error();
    }
    return val;
}
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.