Method: IO#pos=
- Defined in:
- io.c
permalink #pos=(new_position) ⇒ Object
2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 |
# File 'io.c', line 2551
static VALUE
rb_io_set_pos(VALUE io, VALUE offset)
{
rb_io_t *fptr;
rb_off_t pos;
pos = NUM2OFFT(offset);
GetOpenFile(io, fptr);
pos = io_seek(fptr, pos, SEEK_SET);
if (pos < 0 && errno) rb_sys_fail_path(fptr->pathv);
return OFFT2NUM(pos);
}
|