Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Fiber::Scheduler#io_pwrite
io_pwrite(io, buffer, from, offset, length) → written length or -errno
scheduler.c
View on GitHub ↗
VALUE
rb_fiber_scheduler_io_pwrite(VALUE scheduler, VALUE io, rb_off_t from, VALUE buffer, size_t offset, size_t length)
{
if (!rb_respond_to(scheduler, id_io_pwrite)) {
return RUBY_Qundef;
}
VALUE arguments[] = {
scheduler, io, buffer, OFFT2NUM(from), SIZET2NUM(offset), SIZET2NUM(length)
};
return rb_thread_io_blocking_operation(io, fiber_scheduler_io_pwrite, (VALUE)&arguments);
}
Invoked by IO#pwrite or IO::Buffer#pwrite to perform one write of at most length bytes to io at offset from from a specified buffer (see IO::Buffer), starting at the given offset.
This method is semantically the same as io_write, but it allows to specify the offset to write to and is often better for asynchronous IO on the same file.