In CompoundFile.RemoveDirectoryEntry it seems you are attempting to set the file names to random, non identical names. However in practice that does not always happen.
For instance when deleting a file with a lot of small subfiles the tick count used for the Random's seed generation will be the same. Resulting in identical names (this occurred on multiple occasions). This was verified while debugging a separate issue, figure I should note it.
Perhaps instead change it to:
~~~~~~~~~~~~~~~~~~~~~~~~~~
directoryEntries[sid].SetEntryName("DELETED_NAME" + sid);
directoryEntries[sid].StgType = StgType.StgInvalid;
~~~~~~~~~~~~~~~~~~~~~~~~~~~
According to the specification sid is supposed to be a strong key anyways, so this should result in unique names (provided that is not someones ideal file name).
On a side note this should have been an issue from the start, so I do not know why you are requiring strong key names when they are not in the RB-tree.
Who knew a hundred nanoseconds was such a long time.
A hundred nanoseconds can be a lot of time... You're absolutely right. Many thanks for your report. I'm going to integrate in dev branch as soon as possible.
Best Regards,
Federico