3
Vote

Support for occurrences in tar archives

description

(GNU) Tar supports an old feature for archive entries called "append" (as opposed to the typically-seen "update").

This allows a file to be added to the tar archive with the same exact name as another file in the archive.
When extracting, the older "occurrence", as it's called, is effectively lost since the newer "occurrence" is the one that is extracted (unless you specifically use the tar utility and specify the occurrence number to extract).
Documentation is available here: https://www.gnu.org/software/tar/manual/html_node/multiple.html

SevenZipLib uses a dictionary to store the items within the archive as filename (key) -> entry (value). Thus, when attempting to add a second "occurrence" of a filename, the library throws an ArgumentException due to a duplicate key (not supported in a dictionary).

This is caught internally and thrown to the caller as the inner exception of a SevenZipException with the message "The archive may be corrupted". This causes the entire process of opening the archive to fail.

Can someone add support for multiple-"occurrence" files to SevenZipLib, even if (to start) it means only being able to access the last occurrence of a file (since this will be the most common scenario)?

Thanks

comments