Subject: Re: locate(1) (was Re: CVS commit: basesrc)
To: None <tech-userlevel@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-userlevel
Date: 03/08/2000 12:59:07
>> I guess the question is how much of memory comsumed by making find
>> to sort, and guess that not so much as temprary storage used by
>> sort, since the comparison is done in each directory component.

> Uh, but before outputting anything from 'find,' you'd still have to
> have all records in memory before you could output any of them.

No, fortunately; that's the whole point of having find do it.  find can
choose to recurse into subdirectories in lexically sorted order.  For
example, if a directory has subdirs "one", "two", and "three", find can
recurse into "one" first; by the time it returns out of "one", it knows
that all further output will sort after "one", so it can flush
everything up to that point.  Basically, the sort happens at the same
time as the filesystem walk.

					der Mouse

			       mouse@rodents.montreal.qc.ca
		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B