Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

IO#sysseek

ios.sysseek(offset, whence=IO::SEEK_SET) → integer

Seeks to a given offset in the stream according to the value of whence (see IO#seek for values of whence). Returns the new offset into the file.

Example
f = File.new("testfile")
f.sysseek(-13, IO::SEEK_END)   #=> 53
f.sysread(10)                  #=> "And so on."
See also #sysread #syswrite #sync= #tell also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1