Project

General

Profile

Actions

Bug #12413

closed

Dir#close does not raise IOError on already closed handle on OS X

Added by djberg96 (Daniel Berger) almost 8 years ago. Updated almost 8 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
[ruby-core:75679]

Description

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
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0