Re: fts(3) depth or breadth first?

From: Valentin Nechayev (netch_at_segfault.kiev.ua)
Date: 06/04/03


Date: Wed, 4 Jun 2003 22:09:12 +0300


>>> William Ahern wrote:

WA> is there any way to control the depth that fts(3) goes to?

No. fts is only depth first (but in the same time depth last, i.e.
you can ask it to list directory both before and after its contents).
Breadth first order isn't implemented.

WA> if i only want to
WA> see 1 level deep, if i break out after the very first ftsent w/ a depth > 1
WA> will i miss any level 1 files?

Yes, you'll miss them.
As far as I understand its manpage, you can limit depth manually using
FTS_SKIP flag in fts_set() when program sees directory at maximal allowed
depth.

-netch-