Project

General

Profile

Actions

Bug #9327

closed

Why FileUtils.rmdir ignores Errno::ENOTEMPTY ?

Added by bdimych (Dmitry Bolshakov) almost 11 years ago. Updated over 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.0.0p247 (2013-06-27) [i386-mingw32]
Backport:
[ruby-core:59418]

Description

It catches Errno::ENOTEMPTY and Errno::ENOENT and just does nothing.
Most of other FileUtils methods have option "force" which is false by default
but rmdir behaves as if it is true implicitly.
Imho it looks unexpected.


Related issues 1 (0 open1 closed)

Related to Backport191 - Bug #3178: Fileutils#rmdir does rescue Dir Errors without raising newClosedActions

Updated by vajrasky (Vajrasky Kok) almost 11 years ago

It is because we added :parents option in FileUtils.rmdir. See this ticket for detail: https://bugs.ruby-lang.org/issues/3178

I already created patch to improve this situation on that ticket.

Actions #2

Updated by jeremyevans0 (Jeremy Evans) over 5 years ago

  • Related to Bug #3178: Fileutils#rmdir does rescue Dir Errors without raising new added

Updated by jeremyevans0 (Jeremy Evans) over 5 years ago

  • Status changed from Open to Closed
  • Backport deleted (1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN)

This was fixed in 2635984cf2b9b7632f8b35afa2f29d219aba104a. Now Ruby raises if a directory given cannot be removed. It only ignores the exception when deleting parent directories.

Issue 3178 should also been closed, but it is a Backport191 issue and I lack the ability to close it.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0