pyxtf
pyxtf copied to clipboard
Ensure that an index is for the file being read
File indexing has been disabled by default now (https://github.com/oysstu/pyxtf/commit/861a5f52ec30ab8fd83c988aa275d97f9d7958aa), as it caused problems due to it being applied to xtf files automatically based on the file name alone. The index significantly speeds up reading parts of large files, but should have more protection in place to avoid trying to read a file with an invalid index.
Possible solutions include
- Storing a hash of the xtf file in the index (perhaps only of the file header)
- Reverting automatically to reading without an index if the magic numbers (0xFACE) cannot be found.