Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class method

IO.binread

(::path name, ?::Integer? length, ?::Integer offset) -> ::String
IO.binread(path, length = nil, offset = 0) → string or nil

Behaves like IO.read, except that the stream is opened in binary mode with ASCII-8BIT encoding.

See also .binwrite .console also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0