Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static VALUE
- rb_io_seek_m(int argc, VALUE *argv, VALUE io)
- {
- VALUE offset, ptrname;
- int whence = SEEK_SET;
- if (rb_scan_args(argc, argv, "11", &offset, &ptrname) == 2) {
- whence = NUM2INT(ptrname);
- }
- return rb_io_seek(io, offset, whence);
- }
- // and for rb_io_seek
- static VALUE
- rb_io_seek(VALUE io, VALUE offset, int whence)
- {
- rb_io_t *fptr;
- off_t pos;
- pos = NUM2OFFT(offset);
- GetOpenFile(io, fptr);
- pos = io_seek(fptr, pos, whence);
- if (pos < 0 && errno) rb_sys_fail_path(fptr->pathv);
- return INT2FIX(0);
- }
Add Comment
Please, Sign In to add comment