Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Pathname#binread
(?::Integer length, ?::Integer offset) -> ::String
binread(length = nil, offset = 0) → string or nil
pathname_builtin.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/pathname_builtin.rb, line 1238
def binread(...) File.binread(@path, ...) end
Behaves like read, except that the file is opened in binary mode with ASCII-8BIT encoding.