|
I've used flat binary files at work and had to deal with this problem. If you want to be able to handle format changes, one solution is to keep separate metadata files with a version history of the format, and stick a version number at the beginning of each data file. Then whenever you try to read a file that isn't the latest version, convert it to the latest version first using the version history. This gives you a one-time speed hit when you change versions, but otherwise it's as fast as flat binary files. It is, however, quite complicated to implement, especially if you try to include in the metadata enough info to do sensible defaulting of new fields in the structures.
|