Could this be changed to not necessarily a directory but a data structure that can be dumped to disk if needed?  This would potentially allow other uses of the data without necessarily writing to disk or dictating a particular filename.