Would there be a smart way (using the glob crate) to determine the minimum and maximum 'section' from each 'pack' directory - reading the filenames - without having to process all files from the directory?
I don't know if this is possible anyway with a filestystem search mechanism...
(If not I could contemplate creating section directories).
And is the glob crate the 'recommended' crate for searching files?
It looks like you could greatly benefit from storing the data in a database and indexing some metadata about it.
File systems aren't, in general, guaranteed to return glob results in sorted order, so this doesn't seem possible to me without scanning all file names.
True, I contemplated a database.
However, I decided to make the metadata and data completely 'transparently human readable and accessible' by jsons and png's and sound files etc.
It is not a big problem. I will create a 'cached' version anyway during startup of the game.
I think glob returns names garantueed in alphabetical order.
You can just store the file names/paths in the database and keep the actual files on the filesystem.
That is kind of what I am going to do (caching).
I do not store the filenames but the keys, from which it is - by logic - easy to generate the filename.
The 'resourcekey' is fixed in size and can be easily stored in a file.
That is about my plan. The source data is transparent. The cached data is binary, compressed and very fast.
An airtight 'out of sync' plan is not possible I think.