Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
IO.binwrite
(::path name, ::_ToS string, ?::Integer offset, ?mode: ::String mode) -> ::Integer
IO.binwrite(path, string, offset = 0, **opts) → 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.