Skip to content

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

class method

IO.binwrite

IO.binwrite(command, string, offset = 0) → integer
IO.binwrite(path, string, offset = 0) → integer

Behaves like IO.write, except that the stream is opened in binary mode with ASCII-8BIT encoding.

When called from class IO (but not subclasses of IO), this method has potential security vulnerabilities if called with untrusted input; see Command Injection.

See also .binread .console .console_size also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0