Julien Lepiller <jul...@lepiller.eu> writes:

> Why wouldn't it help? Can't you make it a trie from basename -> complete 
> name? If I'm looking for "libcord.so" (which is a key in the trie), I don't 
> think I need to look for every path. I only need to follow the trie until I 
> find a pointer to some structure that contains the data I look for (ex: a 
> list of complete filenames).

Exactly!  It’s somewhat less useful (without pre-processing) for base
names and more useful for absolute file names, where you can quickly
toss out mismatches while traversing the trie.

You could also optimize the data structure by swapping the base name and
the directory name, assuming that users would want to search for either
absolute file names and also for base names (and not for a directory in
between).

-- 
Ricardo

Reply via email to