instance method
ARGF#tell
ARGF.tell → Integer
io.c
View on GitHub ↗
static VALUE
argf_tell(VALUE argf)
{
if (!next_argv()) {
rb_raise(rb_eArgError, "no stream to tell");
}
ARGF_FORWARD(0, 0);
return rb_io_tell(ARGF.current_file);
}
Returns the current offset (in bytes) of the current file in ARGF.
Example
ARGF.pos #=> 0 ARGF.gets #=> "This is line one\n" ARGF.pos #=> 17