Can you rename your files as numbers?

That way you just generate a number that you use to build the file name to open?

Otherwise I don't know if iterating through files with boost::filesystem is "fast".

Joel Lamotte.