From: David Herren Date: 2002-01-23T22:30:38+09:00 Subject: Re: Minor thoughts on 'Find' module Isn't it interesting how we seem to read the same lists.... ;-) On Tuesday, January 22, 2002, at 07:44 PM, Garance A Drosihn wrote: > I think it would be nice to have one or two alternate behaviors > how 'Find' will process a tree of files and directories. Right > now, for any directory in that tree it will process the entries > in that directory in the order they are found. Eg: > somedir > somedir/afile > somedir/subdir > somedir/subdir/bfile > somedir/cfile > somedir/otherdir > somedir/otherdir/dfile > somedir/efile > > I think that in some cases it would be useful if you could tell it > "process all non-directories first", or "process all directories > first". Those options would result in: > somedir > somedir/afile > somedir/cfile > somedir/efile > somedir/subdir > somedir/subdir/bfile > somedir/otherdir > somedir/otherdir/dfile > and > somedir > somedir/subdir > somedir/subdir/bfile > somedir/otherdir > somedir/otherdir/dfile > somedir/afile > somedir/cfile > somedir/efile > or maybe the "depth-first" style of: > somedir/subdir/bfile > somedir/subdir > somedir/otherdir/dfile > somedir/otherdir > somedir/afile > somedir/cfile > somedir/efile > somedir > > I've seen some messages about ways to get ruby to do the depth-first > trick, but I do not remember those as being options to 'Find', which > seems to me to be the logical place to have the option. > > I realize the current behavior is the optimal behavior, as far as > performance of 'Find' is concerned, but there are times when the other > behaviors are preferable. > > disclaimer: I'm still pretty new to ruby, so apologies if I have > just missed something obvious, or if I'm repeating something which > has been said several times before! > > -- Garance Alistair Drosehn = gad@eclipse.acs.rpi.edu > Senior Systems Programmer or gad@freebsd.org > Rensselaer Polytechnic Institute or drosih@rpi.edu > /david -- david herren, shoreham, vermont, usa Hey Osama! Allah would like a word with you...