Scroll to navigation



ffindex_build - build file index from files in directories


USAGE: ffindex_build [-a|-v] [-s] [-f file]* OUT_DATA_FILE OUT_INDEX_FILE [-d 2ND_DATA_FILE -i 2ND_INDEX_FILE] [DIR_TO_INDEX|FILE]*

append files/indexes, also needed for sorting an already existing ffindex
a second ffindex data file for inserting/appending

-i FFINDEX_FILE a second ffindex index file for inserting/appending

file containing a list of file names, one per line -f can be specified up to 4096 times
sort index file, so that the index can queried. Another append operations can be done without sorting.
print version and other info then exit
display this help message


FFINDEX_MAX_INDEX_ENTRIES - allocate memory for this number of entries


Create a new ffindex containing all files from the "bar/" directory containing say myfile1.txt, myfile2.txt and sort (-s) it so that e.g. ffindex_get can use it.
$ ffindex_build -s foo.ffdata foo.ffindex bar/
Add (-a) more files: myfile3.txt, myfile4.txt.
$ ffindex_build -a foo.ffdata foo.ffindex myfile3.txt myfile4.txt
Oops, forgot to sort it (-s) so do it afterwards:
$ ffindex_build -as foo.ffdata foo.ffindex


Compiled with a maximum key/filename length is 63 and default maximum entries 80000000. This can be changed in the sources.

Designed and implemented by Andreas Hauser <>.


User feedback is welcome, especially bugs, performance issues and last but not least convenience of the programs and API.

Email Andreas Hauser

September 2021 ffindex_build version: 0.999 (off_t = 64 bits)