Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[9fans] breadth first walking

3 views
Skip to first unread message

Tim Newsham

unread,
Jan 4, 2010, 12:59:11 AM1/4/10
to
someone mentioned in the thread that it would be nice to be able
to walk directory trees in breadth-first manner:
http://www.thenewsh.com/~newsham/x/9/walk.c

Tim Newsham | www.thenewsh.com/~newsham | thenewsh.blogspot.com

Bruce Ellis

unread,
Jan 4, 2010, 1:24:55 AM1/4/10
to
yep, use a scape tree. ozi is full of them. no hash tables here,
except for my coffee table.

brucee

roger peppe

unread,
Jan 4, 2010, 6:50:45 AM1/4/10
to
what's a scape tree?

2010/1/4 Bruce Ellis <bruce...@gmail.com>:

roger peppe

unread,
Jan 4, 2010, 6:54:29 AM1/4/10
to
2010/1/4 Tim Newsham <new...@lava.net>:

> someone mentioned in the thread that it would be nice to be able
> to walk directory trees in breadth-first manner:
>  http://www.thenewsh.com/~newsham/x/9/walk.c

that's potentially useful, thanks.

BTW, any robust file tree walker in plan 9 should
cope with cycles in the tree. maybe just a linear list of
parents with refcounted nodes might work best for
this implementation.

something like the attached modification to walk.c, perhaps?

walk.c should also eliminate duplicate entries
from union mounts - either by sorting the directory
entries or using a little hash table of names for each directory.
or... use a scape tree?

walk.c

Bruce Ellis

unread,
Jan 4, 2010, 7:05:50 AM1/4/10
to
you were talking and not listening.
0 new messages