From: nobu@... Date: 2014-09-10T06:18:35+00:00 Subject: [ruby-core:64920] [ruby-trunk - Feature #10121] Dir.empty? Issue #10121 has been updated by Nobuyoshi Nakada. https://github.com/nobu/ruby/compare/Feature%2310121-Dir.empty-p ---------------------------------------- Feature #10121: Dir.empty? https://bugs.ruby-lang.org/issues/10121#change-48783 * Author: Robert A. Heiler * Status: Feedback * Priority: Normal * Assignee: * Category: core * Target version: ---------------------------------------- On IRC someone asked how to find out if a directory is empty or not, from within ruby. It seems as if there was no simple way. I suggest adding `Dir.empty?` On IRC, someone else suggested this: ~~~ruby Dir.entries(dir).size == 2 ~~~ I do not know if there are better ways but possibly that could be used for a `Dir.empty?` functionality? -- https://bugs.ruby-lang.org/