On Thursday 19 February 2004 20:03, you wrote: > > Good suggestion. Another way (I did this in a C++ routine) is to keep a > > list of all the directory inodes you process. Every time you open a new > > one, you check it against the list. If it matches anything in the list, > > you skip that one. Of course this would only work for traversing a > > reasonbly sized file tree. > > > > Vaughn > > Was that an ordered or unordered list? (My instinct would be to use an > ordered or perhaps an indexed list.) > > Actually what you want is a perfect hash. Any collision means that you've > visited the node already. (When I last delt with this problem I was > working in PERL and got hashes for free.) > > For a modest set of I-nodes you might use an array. > > There should also be a way to do it very nicely with a combination of array > and bit-mask. Yep, it was a rather small set so I didn't bother to sort them. Hashing would definitely be a good idea for a search of indefinite scope. Vaughn > > > --------------------------------------------------- > PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us > To subscribe, unsubscribe, or to change you mail settings: > http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss