From: Peter Marks Date: 2007-11-09T15:54:05+09:00 Subject: Best way to test if a directory is empty I see this question was asked a while back (http://www.ruby-forum.com/topic/84762), but I'm having trouble implementing any of the solutions. I have tried: if Dir["#{RAILS_ROOT}/documents/"].empty? if catch('empty'){Dir.glob("#{RAILS_ROOT}/documents/"){throw 'empty'}} if Dir.entries("#{RAILS_ROOT}/documents/") == [] , but none seem to work for me. -- Posted via http://www.ruby-forum.com/.