Method: IO#pos
- Defined in:
- io.c
permalink #pos ⇒ Integer #tell ⇒ Integer
2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 |
# File 'io.c', line 2070
static VALUE
rb_io_tell(VALUE io)
{
rb_io_t *fptr;
off_t pos;
GetOpenFile(io, fptr);
pos = io_tell(fptr);
if (pos < 0 && errno) rb_sys_fail_path(fptr->pathv);
pos -= fptr->rbuf.len;
return OFFT2NUM(pos);
}
|