Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
IO.binwrite
IO.binwrite(path, string, offset = 0) → integer
io.c
View on GitHub ↗
static VALUE
rb_io_s_binwrite(int argc, VALUE *argv, VALUE io)
{
return io_s_write(argc, argv, io, 1);
}
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.