From: nobu@... Date: 2016-01-21T03:50:47+00:00 Subject: [ruby-core:73010] [Ruby trunk - Feature #10121] Dir.empty? Issue #10121 has been updated by Nobuyoshi Nakada. Assignee set to Yukihiro Matsumoto On Windows, root directories of drives don't contain "." nor "..", and the suggested code (also `Dir.entries(dirname).join == "..."`) doesn't work. If it is needed in real case, this method should be adopted, I think. ---------------------------------------- Feature #10121: Dir.empty? https://bugs.ruby-lang.org/issues/10121#change-56232 * Author: Robert A. Heiler * Status: Feedback * Priority: Normal * Assignee: Yukihiro Matsumoto ---------------------------------------- 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/ Unsubscribe: