From: ara.t.howard@... Date: 2006-10-17T01:43:00+09:00 Subject: Re: Test if Directory is Empty On Tue, 17 Oct 2006, Nobuyoshi Nakada wrote: > Hi, > > At Mon, 16 Oct 2006 23:19:30 +0900, > ara.t.howard@noaa.gov wrote in [ruby-talk:220018]: >> which someone will probably compact... note that it returns false when the >> first file/dotfile is found. > > !Dir.foreach(dirname) {|n| break true unless /\A\.\.?\z/ =~ n} > !Dir.enum_for(:foreach, dirname).any? {|n| /\A\.\.?\z/ !~ n} nice. double negation is always good! -a -- my religion is very simple. my religion is kindness. -- the dalai lama