класс IOError
Вызывается, когда операция с IO завершается с ошибкой.
File.open("/etc/hosts") {|f| f << "example"}
#=> IOError: not opened for writing
File.open("/etc/hosts") {|f| f.close; f.read }
#=> IOError: closed stream
Обратите внимание, что некоторые ошибки операций с IO вызывают исключения SystemCallError, и эти исключения не являются подклассами IOError:
File.open("does/not/exist")
#=> Errno::ENOENT: No such file or directory - does/not/exist
Ruby Core © 1993–2024 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.