Commit d1fee589 authored by Tomoyuki Sahara's avatar Tomoyuki Sahara

IO.sysopen does retry. closes #26.

parent e7cd0244
......@@ -13,14 +13,7 @@ class File < IO
super(fd_or_path, mode)
else
@path = fd_or_path
begin
fd = IO.sysopen(@path, mode, perm)
rescue RuntimeError => e
raise FileError, "Could not open file (#{e})"
rescue Errno::EMFILE, Errno::ENFILE
GC.start
fd = IO.sysopen(@path, mode, perm)
end
super(fd, mode)
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment