NotSupportedException for 7zip Archive using Ultra Compression
See original GitHub issueI zipped up a file using 7zip (file manager / GUI). I tried with both LZMA and LZMA2, using ultra compression. I can’t seem to figure out how to extract it; I always get a NotSupportedException
.
Here are the two snippets I tried with the archiving API, which supposedly works?
// 1) Archive API? not supported exception.
var archive = ArchiveFactory.Open(archivePath);
archive.WriteToDirectory(outPath, options);
// 2) Archive API: not supported exception
var archive = ArchiveFactory.Open(archivePath);
foreach (var entry in archive.Entries.Where(e => !e.IsDirectory))
{
entry.WriteToDirectory(outPath, options);
}
I think they fail with the same exception. Here’s the stack trace for the second one:
Exception has occurred: CLR/System.NotSupportedException
An unhandled exception of type 'System.NotSupportedException' occurred in SharpCompress.dll: 'Specified method is not supported.'
at SharpCompress.Compressors.LZMA.DecoderRegistry.CreateDecoderStream(CMethodId id, Stream[] inStreams, Byte[] info, IPasswordProvider pass, Int64 limit)
at SharpCompress.Compressors.LZMA.DecoderStreamHelper.CreateDecoderStream(Stream inStream, Int64 startPos, Int64[] packSizes, CFolder folderInfo, IPasswordProvider pass)
at SharpCompress.Common.SevenZip.ArchiveDatabase.GetFolderStream(Stream stream, CFolder folder, IPasswordProvider pw)
at SharpCompress.Common.SevenZip.SevenZipFilePart.GetCompressedStream()
at SharpCompress.Archives.SevenZip.SevenZipArchiveEntry.OpenEntryStream()
at SharpCompress.Archives.IArchiveEntryExtensions.WriteTo(IArchiveEntry archiveEntry, Stream streamToWriteTo)
at SharpCompress.Archives.IArchiveEntryExtensions.<>c__DisplayClass2_0.<WriteToFile>b__0(String x, FileMode fm)
at SharpCompress.Common.ExtractionMethods.WriteEntryToFile(IEntry entry, String destinationFileName, ExtractionOptions options, Action`2 openAndWrite)
at SharpCompress.Archives.IArchiveEntryExtensions.WriteToFile(IArchiveEntry entry, String destinationFileName, ExtractionOptions options)
at SharpCompress.Common.ExtractionMethods.WriteEntryToDirectory(IEntry entry, String destinationDirectory, ExtractionOptions options, Action`2 write)
at SharpCompress.Archives.IArchiveEntryExtensions.WriteToDirectory(IArchiveEntry entry, String destinationDirectory, ExtractionOptions options)
I’m sure it must be something I’m doing wrong (perhaps in my 7zip archive creation?) but I can’t figure out what or how to make this work.
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (8 by maintainers)
Top Results From Across the Web
7zip Ultra LZMA2 compression - batch file
I'm not sure as of which 7z version it barfs on -d=1024m , but this works for version 16.04 on Windows: 7z.exe a...
Read more >ZipFile.CreateFromDirectory Method
Creates a zip archive that contains the files and directories from the specified directory, uses the specified compression level, and optionally includes ...
Read more >What is the best configuration to 7zip for maximum ...
I've been using 7zip for a while now, I'd like your feedback on what the best settings would be for a maximum compression...
Read more >What compression options does 7Zip use when you add ...
To change the compression scheme, 1. Unpack all files in the archive. 2. Select all in 7-Zip. 3. Add to a new compressed...
Read more >How to recover corrupted 7z archive
How to recover corrupted 7z archive. Try latest version of 7-Zip. It's possible that new version of 7-Zip can solve your problems with...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Both my delta test file and the original archive it was based on extracted seemingly perfectly, and the music files were the quickest to extract out of almost all other files that I could tell.
Thanks Erior. I’ve been away for personal reasons.