Method: IO#pos
- Defined in:
- io.c
#pos ⇒ Integer #tell ⇒ Integer
1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 |
# File 'io.c', line 1526
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);
}
|