ara.t.howard / noaa.gov wrote:
> On Mon, 16 Oct 2006, Daniel Berger wrote:
>
> > lroland / gmail.com wrote:
> >> Hi all
> >>
> >> I browsed through the FileUtils and Dir documentation and found no
> >> obvious way to test if a directory exists and is empty. Various hacks
> >> can be used (like checking file count and size, testing if the
> >> directory can be deleted..) but they all left me wondering if i some
> >> how missed a Dir.isEmpty? like method ?
> >>
> >> So in short is there a real Ruby way of telling whether a directory if
> >> empty
> >
> > if Dir["/foo/bar/*"].empty?
>
> that'll crawl if a directory is huge though

<snip>

True.  Oh, look - Windows has a PathIsDirectoryEmpty() function. :)

win32-dir 0.3.1 coming soon....

Thanks,

Dan