From 1e8097a4b895e673846be848feffdd0556041a65 Mon Sep 17 00:00:00 2001 From: Tomoyuki Sahara Date: Sat, 16 Nov 2013 05:12:22 +0900 Subject: IO.sysopen raises an exception when open(2) fails. closes #6. --- mrblib/file.rb | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'mrblib') diff --git a/mrblib/file.rb b/mrblib/file.rb index 5b6986985..243549cbb 100644 --- a/mrblib/file.rb +++ b/mrblib/file.rb @@ -14,20 +14,7 @@ class File < IO super(fd_or_path, mode) else @path = fd_or_path - - perm = 0666 unless perm.is_a? Fixnum fd = IO.sysopen(@path, mode, perm) - if fd < 0 && Object.const_defined?(:Errno) - begin - Errno.handle @path - rescue Errno::EMFILE - GC.run(true) - fd = IO.sysopen(@path, mode, perm) - Errno.handle if fd < 0 - end - elsif fd < 0 - raise NoFileError.new "no such file or directory" - end super(fd, mode) end end -- cgit v1.2.3