raw!

io.raw!(min: nil, time: nil) Instance Public methods Enables raw mode. If the terminal mode needs to be back, use io.raw { ⦠}. You must require 'io/console' to use this method.

read 2

ios.read([length [, outbuf]]) â string, outbuf, or nil Instance Public methods Reads length bytes from the I/O stream. length must be a non-negative integer or nil. If length is a positive integer, it try to read length bytes without any conversion (binary mode). It returns nil or a string whose length is 1 to length bytes. nil means it met EOF at beginning. The 1 to length-1 bytes string means it met EOF after reading the result. The length bytes string means it doesn't meet E

read_nonblock

ios.read_nonblock(maxlen) â stringios.read_nonblock(maxlen, outbuf) â outbuf Instance Public methods Reads at most maxlen bytes from ios using the read(2) system call after O_NONBLOCK is set for the underlying file descriptor. 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. #read_nonblock just calls th

readbyte

ios.readbyte â fixnum Instance Public methods Reads a byte as with IO#getbyte, but raises an EOFError on end of file.

readchar

ios.readchar â string Instance Public methods Reads a one-character string from ios. Raises an EOFError on end of file. f = File.new("testfile") f.readchar #=> "h" f.readchar #=> "e"

readline

ios.readline(sep=$/) â stringios.readline(limit) â stringios.readline(sep, limit) â string Instance Public methods Reads a line as with IO#gets, but raises an EOFError on end of file.

readlines 2

ios.readlines(sep=$/) â arrayios.readlines(limit) â arrayios.readlines(sep, limit) â array Instance Public methods Reads all of the lines in ios, and returns them in anArray. Lines are separated by the optional sep. If sep is nil, the rest of the stream is returned as a single record. If the first argument is an integer, or optional second argument is given, the returning string would not be longer than the given value in bytes. The stream must be opened for reading or a

readpartial

ios.readpartial(maxlen) â stringios.readpartial(maxlen, outbuf) â outbuf Instance Public methods Reads at most maxlen bytes from the I/O stream. It blocks only if ios has no data immediately available. It doesn't block if some data available. 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 EO

ready?

io.ready? â true, false or nil Instance Public methods Returns true if input available without blocking, or false. Returns nil if no information available.

reopen

ios.reopen(other_IO) â iosios.reopen(path, mode_str) â ios Instance Public methods Reassociates ios with the I/O stream given in other_IO or to a new stream opened on path. This may dynamically change the actual class of this stream. f1 = File.new("testfile") f2 = File.new("testfile") f2.readlines[0] #=> "This is line one\n" f2.reopen(f1) #=> #<File:testfile> f2.readlines[0] #=> "This is line one\n"