nread

io.nread â int Instance Public methods Returns number of bytes that can be read without blocking. Returns zero if no information available.

oflush

io.oflush Instance Public methods Flushes output buffer in kernel. You must require 'io/console' to use this method.

pid

ios.pid â fixnum Instance Public methods Returns the process ID of a child process associated with ios. This will be set by IO.popen. pipe = IO.popen("-") if pipe $stderr.puts "In parent, child pid is #{pipe.pid}" else $stderr.puts "In child, pid is #{$$}" end produces: In child, pid is 26209 In parent, child pid is 26209

pos

ios.pos â integer Instance Public methods Returns the current offset (in bytes) of ios. f = File.new("testfile") f.pos #=> 0 f.gets #=> "This is line one\n" f.pos #=> 17

pos=

ios.pos = integer â integer Instance Public methods Seeks to the given position (in bytes) in ios. It is not guranteed that seeking to the right position when ios is textmode. f = File.new("testfile") f.pos = 17 f.gets #=> "This is line two\n"

print

ios.print() â nilios.print(obj, ...) â nil Instance Public methods Writes the given object(s) to ios. The stream must be opened for writing. If the output field separator ($,) is not nil, it will be inserted between each object. If the output record separator ($\) is not nil, it will be appended to the output. If no arguments are given, prints $_. Objects that aren't strings will be converted by calling their to_s method. With no argument, prints the contents of th

printf

ios.printf(format_string [, obj, ...]) â nil Instance Public methods Formats and writes to ios, converting parameters under control of the format string. See Kernel#sprintf for details.

putc

ios.putc(obj) â obj Instance Public methods If obj is Numeric, write the character whose code is the least-significant byte of obj, otherwise write the first byte of the string representation of obj to ios. Note: This method is not safe for use with multi-byte characters as it will truncate them. $stdout.putc "A" $stdout.putc 65 produces: AA

puts

ios.puts(obj, ...) â nil Instance Public methods Writes the given objects to ios as with IO#print. Writes a record separator (typically a newline) after any that do not already end with a newline sequence. If called with an array argument, writes each element on a new line. If called without arguments, outputs a single record separator. $stdout.puts("this", "is", "a", "test") produces: this is a test

raw

io.raw(min: nil, time: nil) {|io| } Instance Public methods Yields self within raw mode. STDIN.raw(&:gets) will read and return a line without echo back and line editing. You must require 'io/console' to use this method.