[ruby-core:76012] [Ruby trunk Bug#12413] Dir#close does not raise IOError on already closed handle on OS X
From:
nagachika00@...
Date:
2016-06-13 18:49:44 UTC
List:
ruby-core #76012
Issue #12413 has been updated by Tomoyuki Chikanaga.
Backport changed from 2.1: DONTNEED, 2.2: DONTNEED, 2.3: REQUIRED to 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONE
ruby_2_3 r55405 merged revision(s) 55120.
----------------------------------------
Bug #12413: Dir#close does not raise IOError on already closed handle on OS X
https://bugs.ruby-lang.org/issues/12413#change-59211
* Author: Daniel Berger
* Status: Closed
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
* Backport: 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONE
----------------------------------------
The docs for Dir#close say "Closes the directory stream. Any further attempts to access dir will raise an IOError."
dir = Dir.new(Dir.pwd)
dir.close # nil
Here, I would expect another call to dir to raise an IOError, but it doesn't. On OS X it just returns nil.
dir.close # nil again (and again)
Whereas on both Linux and Windows I get the expected error:
IOError: closed directory
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>