Outpost 2 searches the VOL index entries using binary search, comparing strings using strcmp, which is case sensitive. It does a simple binary compare of the bytes, without regards to locale or other special sort considerations. As such, lowercase letters, which have a lower value ASCII code, must be sorted before uppercase letters.If a different sort order is used, the binary search can get confused when encountering an out of place entry and search the wrong direction. That can result in files not being found, even though they are clearly listed in the index table. And to make matters confusing, the way the binary search jumps around the index table, it can make which files are not found seem random (though it is deterministic for each set of packed files).
I'm afraid you have no choice but to sort all uppercase filenames before all lowercase filenames.Edit:
Upon closer examination of the code, it seems the function was misidentified as "strcmp". It's actually not so simple. There is a memory flag that controls whether a simple case insensitive compare is used, or a or more complicated comparison is done, which looks like it might remap character codes. Maybe it's actually
strcoll, or perhaps
_stricmp. It appears the default is a simple case insensitive compare. If the characters are different, it attempts to remap upper case characters so they would compare equal to their lower case equivalents.
I suppose this means there are multiple possible sort orders, depending on the memory flag affecting the compare. That would of course completely break VOL files if it ever changed. As such, I'd go with a function that does a simple case insensitive compare.
Another way to solve the problem would be to try to eliminate the template files by either somehow storing the templates in the executable or maybe as a resource or something. Or perhaps modifying the Archive code to allow easier creation of vol and clm files without an initial template.
Agreed. These would be better solutions, particularly not needing template files.
I would recommend against using a hardcoded path, even with an installer, as people sometimes choose to install to a different path. Plus it's nice to not need an installer. Hardcoded absolute paths are almost always a bad idea.
Of course this problem stems from building on badly structured code that I wrote.