From: Eric Wong Date: 2011-04-08T15:29:16+09:00 Subject: [ruby-core:35661] Re: [Ruby 1.8 - Bug #4563] Dir#tell broken Daniel Berger wrote: > I was expecting "1", in part because of the example from the pickaxe, > and also because that's what JRuby returns. OS X 10.4 returns a simple > index, too. However, I now see it's not necessarily just a simple > index, depending on the platform. Yes, readdir/telldir aren't guaranteed to have any ordering. ext3 created with dir_index and ext4 (I think) do this to you, maybe others. You can search for the spd_readdir LD_PRELOAD from Ted T'so to get readdir() to sort by inode like you'd expect. spd_readdir can reduce disk seeks if you're iterating through a directory, too. -- Eric Wong