From: Robert Klemme Date: 2007-03-10T19:50:05+09:00 Subject: Re: Find.find --- returns directories/files backwards On 10.03.2007 01:33, Brad wrote: > It seems to me when I run: > Find.find('/user/name/documents') {|path| puts path} > > it returns all the directories in the reverse order. I was expecting > the directories to be returned in alphabetical order, but that doesn't > seem to be the case. Also, in one case it reads half of a directory's > files, then the sub dirs and then it finished reading the rest of the > directory it started in and finished writing them in the Puts > statement. > > Am I missing something? How do you do get it to write out the > directories in alphabetical order? As others said already, the order is dictated by how the OS returns entries. Here's another solution: puts Dir['/user/name/documents/**/*'].sort Kind regards robert