fcntl

ios.fcntl(integer_cmd, arg) â integer Instance Public methods Provides a mechanism for issuing low-level commands to control or query file-oriented I/O streams. Arguments and results are platform dependent. If arg is a number, its value is passed directly. If it is a string, it is interpreted as a binary sequence of bytes (Array#pack might be a useful way to build this string). On Unix platforms, see fcntl(2) for details. Not implemented on all platforms.

external_encoding

io.external_encoding â encoding Instance Public methods Returns the Encoding object that represents the encoding of the file. If io is write mode and no encoding is specified, returns nil.

expect

IO#expect(pattern,timeout=9999999) â ArrayIO#expect(pattern,timeout=9999999) { |result| ... } â nil Instance Public methods Reads from the IO until the given pattern matches or the timeout is over. It returns an array with the read buffer, followed by the matches. If a block is given, the result is yielded to the block and returns nil. When called without a block, it waits until the input that matches the given pattern is obtained from the IO or the time specifi

eof?

ios.eof? â true or false Instance Public methods Returns true if ios is at end of file that means there are no more data to read. The stream must be opened for reading or an IOError will be raised. f = File.new("testfile") dummy = f.readlines f.eof #=> true If ios is a stream such as pipe or socket, IO#eof? blocks until the other end sends some data or closes it. r, w = IO.pipe Thread.new { sleep 1; w.close } r.eof? #=> true after 1 second blocking r, w = IO.pipe Thre

eof

ios.eof â true or falseios.eof? â true or false Instance Public methods Returns true if ios is at end of file that means there are no more data to read. The stream must be opened for reading or an IOError will be raised. f = File.new("testfile") dummy = f.readlines f.eof #=> true If ios is a stream such as pipe or socket, IO#eof? blocks until the other end sends some data or closes it. r, w = IO.pipe Thread.new { sleep 1; w.close } r.eof? #=> true after 1 second bl

echo?

io.echo? â true or false Instance Public methods Returns true if echo back is enabled. You must require 'io/console' to use this method.

echo=

io.echo = flag Instance Public methods Enables/disables echo back. On some platforms, all combinations of this flags and raw/cooked mode may not be valid. You must require 'io/console' to use this method.

each_line

ios.each_line(sep=$/) {|line| block } â iosios.each_line(limit) {|line| block } â iosios.each_line(sep,limit) {|line| block } â iosios.each_line(...) â an_enumerator Instance Public methods Executes the block for every line in ios, where lines are separated by sep. ios must be opened for reading or an IOError will be raised. If no block is given, an enumerator is returned instead. f = File.new("testfile") f.each {|line| puts "#{f.lineno}: #{line}" } pr

each_codepoint

ios.each_codepoint {|c| block } â iosios.codepoints {|c| block } â iosios.each_codepoint â an_enumeratorios.codepoints â an_enumerator Instance Public methods Passes the Integer ordinal of each character in ios, passing the codepoint as an argument. The stream must be opened for reading or an IOError will be raised. If no block is given, an enumerator is returned instead.

each_char

ios.each_char {|c| block } â iosios.each_char â an_enumerator Instance Public methods Calls the given block once for each character in ios, passing the character as an argument. The stream must be opened for reading or an IOError will be raised. If no block is given, an enumerator is returned instead. f = File.new("testfile") f.each_char {|c| print c, ' ' } #=> #<File:testfile>