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.

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.

fdatasync

ios.fdatasync â 0 or nil Instance Public methods Immediately writes all buffered data in ios to disk. If the underlying operating system does not support fdatasync(2), IO#fsync is called instead (which might raise a NotImplementedError).

fileno

ios.fileno â fixnumios.to_i â fixnum Instance Public methods Returns an integer representing the numeric file descriptor for ios. $stdin.fileno #=> 0 $stdout.fileno #=> 1 to_i

flush

ios.flush â ios Instance Public methods Flushes any buffered data within ios to the underlying operating system (note that this is Ruby internal buffering only; the OS may buffer the data as well). $stdout.print "no newline" $stdout.flush produces: no newline

fsync

ios.fsync â 0 or nil Instance Public methods Immediately writes all buffered data in ios to disk. Note that fsync differs from using IO#sync=. The latter ensures that data is flushed from Ruby's buffers, but does not guarantee that the underlying operating system actually writes it to disk. NotImplementedError is raised if the underlying operating system does not support fsync(2).

getbyte

ios.getbyte â fixnum or nil Instance Public methods Gets the next 8-bit byte (0..255) from ios. Returns nil if called at end of file. f = File.new("testfile") f.getbyte #=> 84 f.getbyte #=> 104

getc

ios.getc â string or nil Instance Public methods Reads a one-character string from ios. Returns nil if called at end of file. f = File.new("testfile") f.getc #=> "h" f.getc #=> "e"

getch

io.getch(min: nil, time: nil) â char Instance Public methods Reads and returns a character in raw mode. You must require 'io/console' to use this method.

gets

ios.gets(sep=$/) â string or nilios.gets(limit) â string or nilios.gets(sep, limit) â string or nil Instance Public methods Reads the next âline'' from the I/O stream; lines are separated by sep. A separator of nil reads the entire contents, and a zero-length separator reads the input a paragraph at a time (two successive newlines in the input separate paragraphs). The stream must be opened for reading or an IOError will be raised. The line read in will be returned and al