Forum: Ruby-dev [Closed] "Error: TestFileUtils#test_rmdir: Errno::EEXIST: File exists @ dir_s_rmdir - data" on Solar

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
unknown (Guest)
on 2014-04-25 16:29
(Received via mailing list)
Issue #9571 has been updated by Naohisa Goto.

Status changed from Open to Closed
% Done changed from 0 to 100

Applied in changeset r45720.

* lib/fileutils.rb (rmdir): rescue Errno::EEXIST in addition to
  ENOTEMPTY (and ENOENT), because SUSv3 describes that "If the
  directory is not an empty directory, rmdir() shall fail and set
  errno to [EEXIST] or [ENOTEMPTY]" and Solaris uses EEXIST.
  [Bug #9571] [ruby-dev:48017]

Bug #9571: "Error: TestFileUtils#test_rmdir: Errno::EEXIST: File exists
@ dir_s_rmdir - data" on Solaris

* Author: Naohisa Goto
* Status: Closed
* Priority: Normal
* Assignee:
* Category:
* Target version:
* ruby -v: ruby 2.2.0dev (2014-02-26) [sparc64-solaris2.10]
* Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN
Solarisにて、いつからかは忘れましたが、make test-all にて以下のErrorが生じています。

    52) Error:
    Errno::EEXIST: File exists @ dir_s_rmdir - data
    /XXXXX/lib/fileutils.rb:277:in `rmdir'
    /XXXXX/lib/fileutils.rb:277:in `block in rmdir'
    /XXXXX/lib/fileutils.rb:271:in `each'
    /XXXXX/lib/fileutils.rb:271:in `rmdir'
    /XXXXX/test/fileutils/test_fileutils.rb:1380:in `block in
    /XXXXX/lib/test/unit/assertions.rb:166:in `assert_nothing_raised'
    /XXXXX/test/fileutils/test_fileutils.rb:1379:in `test_rmdir'

Solaris では、中身が残っているディレクトリをrmdirしようとしたとき、errno に EEXIST をセットします。

    $ irb
    irb(main):001:0> Dir.mkdir('aaa')
    => 0
    irb(main):002:0> Dir.mkdir('aaa/bbb')
    => 0
    irb(main):003:0> Dir.rmdir('aaa')
    Errno::EEXIST: File exists - aaa
    from (irb):3:in `rmdir'
    from (irb):3
    from /usr/local/64/bin/irb:12:in `<main>'

SunOS 4 では ENOTEMPTY を使用していたが Solaris では EEXIST に変更になったとの記述も見つけました。

This topic is locked and can not be replied to.