ios.write(string) â integer Instance Public methods Writes the given string to ios. The stream must be opened for writing. If the argument is not a string, it will be converted to a string using to_s. Returns the number of bytes written. count = $stdout.write("This is a test\n") puts "That was #{count} bytes of data" produces: This is a test That was 15 bytes of data
io.winsize = [rows, columns] Instance Public methods Tries to set console size. The effect depends on the platform and the running environment. You must require 'io/console' to use this method.
io.winsize â [rows, columns] Instance Public methods Returns console size. You must require 'io/console' to use this method.
io.wait_writable â IOio.wait_writable(timeout) â IO or nil Instance Public methods Waits until IO writable is available or times out and returns self or nil when EOF is reached.
io.wait â IO, true, false or nilio.wait(timeout) â IO, true, false or nil Instance Public methods Waits until input is available or times out and returns self or nil when EOF is reached.
ios.ungetc(string) â nil Instance Public methods Pushes back one character (passed as a parameter) onto ios, such that a subsequent buffered character read will return it. Only one character may be pushed back before a subsequent read operation (that is, you will be able to read only the last of several characters that have been pushed back). Has no effect with unbuffered reads (such as IO#sysread). f = File.new("testfile") #=> #<File:testfile> c = f.getc
ios.ungetbyte(string) â nilios.ungetbyte(integer) â nil Instance Public methods Pushes back bytes (passed as a parameter) onto ios, such that a subsequent buffered read will return it. Only one byte may be pushed back before a subsequent read operation (that is, you will be able to read only the last of several bytes that have been pushed back). Has no effect with unbuffered reads (such as IO#sysread). f = File.new("testfile") #=> #<File:testfile> b = f.getbyte
ios.tty? â true or false Instance Public methods Returns true if ios is associated with a terminal device (tty), false otherwise. File.new("testfile").isatty #=> false File.new("/dev/tty").isatty #=> true
ios.to_io â ios Instance Public methods Returns ios.
Page 1905 of 2275