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#syswrite

ios.syswrite(string) → integer

Writes the given string to ios using a low-level write. Returns the number of bytes written. Do not mix with other methods that write to ios or you may get unpredictable results. Raises SystemCallError on error.

Example
f = File.new("out", "w")
f.syswrite("ABCDEF")   #=> 6
See also #sysseek #tell #sysread #to_i also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1