Skip to content
instance method

ARGF#readpartial

ARGF.readpartial(maxlen) → string
ARGF.readpartial(maxlen, outbuf) → outbuf

Reads at most maxlen bytes from the ARGF stream.

If the optional outbuf argument is present, it must reference a String, which will receive the data. The outbuf will contain only the received data after the method call even if it is not empty at the beginning.

It raises EOFError on end of ARGF stream. Since ARGF stream is a concatenation of multiple files, internally EOF is occur for each file. ARGF.readpartial returns empty strings for EOFs except the last one and raises EOFError for the last one.

See also #read_nonblock #rewind #readlines #seek also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0