End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Pathname#binwrite
pathname.binwrite(string, [offset] ) => fixnum
pathname.binwrite(string, [offset], open_args ) => fixnum
ext/pathname/pathname.c
View on GitHub ↗
static VALUE
path_binwrite(int argc, VALUE *argv, VALUE self)
{
VALUE args[4];
int n;
args[0] = get_strpath(self);
n = rb_scan_args(argc, argv, "03", &args[1], &args[2], &args[3]);
return rb_funcallv_kw(rb_cFile, id_binwrite, 1+n, args, RB_PASS_CALLED_KEYWORDS);
}
Writes contents to the file, opening it in binary mode.
See File.binwrite.