Why is find so slow (Re: Why use find?)

David W. Tamkin dattier at ddsw1.MCS.COM
Fri Oct 19 07:37:33 AEST 1990


mercer at npdiss1.StPaul.NCR.COM (Dan Mercer) wrote in
<638 at npdiss1.StPaul.NCR.COM>:

| Maybe I'm dense,  but how does find know whether a file is a directory
| (and should be descended) or another type of file without stat()ing the
| file?

I think the idea is that after find does stat() the file and sees that it is
a directory with only two links, it shouldn't bother stat()ting the entries
in that directory because none of them will be subdirectories.  There will
be only one more level to descend.

David Tamkin  Box 7002  Des Plaines IL  60018-7002  708 518 6769  312 693 0591
MCI Mail: 426-1818  GEnie: D.W.TAMKIN  CIS: 73720,1570   dattier at ddsw1.mcs.com



More information about the Comp.unix.internals mailing list