Robert G. Brown wrote:> (where seeks are much more expensive than sequential reads and> where stating a few thousand files means MINIMALLY a few thousand seeks> at 5-10 msec/each -- definitely macroscopic time). Note that this can> easily take longer than the actual reading of the file(s).

Please note you don't _have_ to call stat() in the order returned byreaddir(). If you sort by inode number first, then on almost allfilesystems you'll get a speedup because that usually sorts the diskaccesses.