chars

chars() Instance Public methods This is a deprecated alias for each_char.

close

ios.close â nil Instance Public methods Closes ios and flushes any pending writes to the operating system. The stream is unavailable for any further data operations; an IOError is raised if such an attempt is made. I/O streams are automatically closed when they are claimed by the garbage collector. If ios is opened by IO.popen, close sets $?.

close_on_exec=

ios.close_on_exec = bool â true or false Instance Public methods Sets a close-on-exec flag. f = open("/dev/null") f.close_on_exec = true system("cat", "/proc/self/fd/#{f.fileno}") # cat: /proc/self/fd/3: No such file or directory f.closed? #=> false Ruby sets close-on-exec flags of all file descriptors by default since Ruby 2.0.0. So you don't need to set by yourself. Also, unsetting a close-on-exec flag can cause file descriptor leak if another thread use fo

close_on_exec?

ios.close_on_exec? â true or false Instance Public methods Returns true if ios will be closed on exec. f = open("/dev/null") f.close_on_exec? #=> false f.close_on_exec = true f.close_on_exec? #=> true f.close_on_exec = false f.close_on_exec? #=> false

close_read

ios.close_read â nil Instance Public methods Closes the read end of a duplex I/O stream (i.e., one that contains both a read and a write stream, such as a pipe). Will raise an IOError if the stream is not duplexed. f = IO.popen("/bin/sh","r+") f.close_read f.readlines produces: prog.rb:3:in `readlines': not opened for reading (IOError) from prog.rb:3

close_write

ios.close_write â nil Instance Public methods Closes the write end of a duplex I/O stream (i.e., one that contains both a read and a write stream, such as a pipe). Will raise an IOError if the stream is not duplexed. f = IO.popen("/bin/sh","r+") f.close_write f.print "nowhere" produces: prog.rb:3:in `write': not opened for writing (IOError) from prog.rb:3:in `print' from prog.rb:3

closed?

ios.closed? â true or false Instance Public methods Returns true if ios is completely closed (for duplex streams, both reader and writer), false otherwise. f = File.new("testfile") f.close #=> nil f.closed? #=> true f = IO.popen("/bin/sh","r+") f.close_write #=> nil f.closed? #=> false f.close_read #=> nil f.closed? #=> true

codepoints

codepoints() Instance Public methods This is a deprecated alias for each_codepoint.

cooked

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

cooked!

io.cooked! Instance Public methods Enables cooked mode. If the terminal mode needs to be back, use io.cooked { ⦠}. You must require 'io/console' to use this method.