Re: documentation patch for Dir::glob
"Konrad Meyer" <[email protected]> Thu, 2 Aug 2007 19:54:42 -0700
| Newsgroups | gmane.comp.lang.ruby.documentation |
|---|---|
| Message-ID | <[email protected]> |
On 02/08/07, Tim Harper <[email protected]> wrote: > I was surprised earlier to find out that Dir::glob returns recursive results > in a different order given different operating systems. For example: > Consider the following directory structure: > > dir/file1.txt > > dir/file2.txt > > a_file.txt > > file1.txt > > file2.txt > ... I'm pretty sure the order of Dir::glob can't be counted on, and you should sort however you need to. The current documentation mentions nothing about the order being in any sort of dependable order. My findings are that in a directory of 001, 002, 003, ..., 009, the array returned by Dir::glob is not sorted at all.