Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

Fiber::Scheduler#io_pread

io_pread(io, buffer, from, offset, length) → read length or -errno

Invoked by IO#pread or IO::Buffer#pread to perform one read of at most length bytes from io at offset from into a specified buffer (see IO::Buffer), starting at the given offset.

This method is semantically the same as io_read, but it allows to specify the offset to read from and is often better for asynchronous IO on the same file.