Maintenance of Ruby 2.0.0 ended on February 24, 2016. Read more

In Files

  • io.c



Raised when an IO operation fails."/etc/hosts") {|f| f << "example"}
  #=> IOError: not opened for writing"/etc/hosts") {|f| f.close; }
  #=> IOError: closed stream

Note that some IO failures raise +SystemCallError+s and these are not subclasses of IOError:"does/not/exist")
  #=> Errno::ENOENT: No such file or directory - does/not/exist