Skip to content
class method

IO.binread

(::String 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.

When called from class IO (but not subclasses of IO), this method has potential security vulnerabilities if called with untrusted input; see Command Injection.

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