Thanks for sharing this, Kevin. It’s a useful plugin, and I appreciate you making it available. I tested 1.0.3 on macOS and found a few things to fix.
The most important issue is the risk of damaging source files. Saving an archive inside the folder being compressed makes it try to include its own output and fail. If the destination is an existing file in that folder, it can modify that source file before reporting the error. I’d reject destinations inside the source folder before opening any output, then write to a temporary file outside that folder and move it into place only after success.
The other issues were:
- 7z: Creation works, but listing and extraction fail. Use
SevenZipArchive.OpenArchive() for those operations; the bundled version doesn’t support 7z through ReaderFactory.OpenReader().
- GZip, BZip2, XZ and LZip: The plugin couldn’t extract its own output. Direct decoding with
CompressionProviderRegistry.Default.CreateDecompressStream() worked for all four, so I’d handle standalone streams that way. Give unnamed output a sensible filename, such as the input name without its compression suffix, and use that name in ListEntries() too.
- Empty directories: ZIP/TAR extraction loses them because directory entries are skipped. Passing those entries to
WriteEntryToDirectory() fixed this in my checks.
- RAR reporting: Append
Rar to the enum and include it in ReadFormats(), while keeping it out of WriteFormats() and returning false from CanWrite().
One small packaging point: the plugin says MIT, but the demo displays restrictive donationware terms. I’d clarify which licence applies to each part and include the full SharpCompress licence.
A small round-trip test for each format would help catch these before uploading. Thanks again for contributing this!