Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Pathname#binwrite
(::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
binwrite(string, offset = 0, **opts) → nonnegative_integer
pathname_builtin.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/pathname_builtin.rb, line 1364
def binwrite(...) File.binwrite(@path, ...) end
Behaves like write, except that the file is opened in binary mode with ASCII-8BIT encoding.