Re: you are in an fs with millions of small files

From: Peter Jeremy <PeterJeremy_at_optushome.com.au>
Date: Thu, 9 Jun 2005 05:05:58 +1000
On Wed, 2005-Jun-08 18:38:59 +0200, Dag-Erling Smørgrav wrote:
>des_at_des.no (Dag-Erling Smørgrav) writes:
>> Giorgos Keramidas <keramida_at_freebsd.org> writes:
>> > This would require updates/changes to all the users of fts.h too?
>> No.  They access the list through fts_next().
>
>ARRRGH!  They're supposed to, but of course some don't: ls(1), ctm(1)
>and mtree(8).

Why 'ARRRGH!'?  fts(3) documents the use of fts_children() to allow
the list to be traversed using fts_link.  Converting from a tree to a
linked list is not rocket-science - fts_next() has to do an ordered
traversal.  At the most simplistic level, all you need to do is
iterate fts_next() and turn the output into a list in fts_link.

-- 
Peter Jeremy
Received on Wed Jun 08 2005 - 17:06:10 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:36 UTC