Ruby 4.1 リファレンスマニュアル

instance method Pathname#binwrite

binwrite(string, offset=nil) -> IntegerRuby 2.1.0 から[permalink][rdoc][edit]
(String, ?Integer offset, ?mode: Integer | String, ?flags: Integer, ?external_encoding: encoding, ?internal_encoding: encoding, ?encoding: encoding, ?textmode: boolish, ?binmode: boolish, ?autoclose: boolish, ?invalid: :replace ?, ?undef: :replace ?, ?replace: String, ?fallback: Hash[String, String] | Proc | Method, ?xml: :text | :attr, ?universal_newline: true, ?cr_newline: true, ?crlf_newline: true) → Integer

IO.binwrite(self.to_s, *args)と同じです。

[SEE_ALSO] IO.binwrite