Can not open tgz file #601

Open
opened 2026-01-29 22:14:24 +00:00 by claunia · 0 comments
Owner

Originally created by @Broeckl on GitHub (Nov 21, 2023).

Opening the attached file with this code fails:

            using (Stream stream = File.OpenRead(file))
            using (IReader reader = ReaderFactory.Open(stream))
            {
                while (reader.MoveToNextEntry())
                {
                    if (!reader.Entry.IsDirectory)
                    {
                        reader.WriteEntryToDirectory(outputFolder, new ExtractionOptions
                        {
                            ExtractFullPath = true, Overwrite = true
                        });
                    }
                }
            }

An ArgumentException with "Value cannot be null. (Parameter 'path2')" occurs here:

at System.IO.Path.Combine(String path1, String path2) in System.IO\Path.cs:line 316
at SharpCompress.Common.ExtractionMethods.WriteEntryToDirectory(IEntry entry, String destinationDirectory, ExtractionOptions options, Action`2 write) in SharpCompress.Common\ExtractionMethods.cs:line 31
at SharpCompress.Readers.IReaderExtensions.WriteEntryToDirectory(IReader reader, String destinationDirectory, ExtractionOptions options) in SharpCompress.Readers\IReaderExtensions.cs:line 32

The file can be opened with 7Zip. Your library can cope with comparable files. Any help is appreciated.

03069284-040101.tgz

Originally created by @Broeckl on GitHub (Nov 21, 2023). Opening the attached file with this code fails: using (Stream stream = File.OpenRead(file)) using (IReader reader = ReaderFactory.Open(stream)) { while (reader.MoveToNextEntry()) { if (!reader.Entry.IsDirectory) { reader.WriteEntryToDirectory(outputFolder, new ExtractionOptions { ExtractFullPath = true, Overwrite = true }); } } } An ArgumentException with "Value cannot be null. (Parameter 'path2')" occurs here: at System.IO.Path.Combine(String path1, String path2) in System.IO\Path.cs:line 316 at SharpCompress.Common.ExtractionMethods.WriteEntryToDirectory(IEntry entry, String destinationDirectory, ExtractionOptions options, Action`2 write) in SharpCompress.Common\ExtractionMethods.cs:line 31 at SharpCompress.Readers.IReaderExtensions.WriteEntryToDirectory(IReader reader, String destinationDirectory, ExtractionOptions options) in SharpCompress.Readers\IReaderExtensions.cs:line 32 The file can be opened with 7Zip. Your library can cope with comparable files. Any help is appreciated. [03069284-040101.tgz](https://github.com/adamhathcock/sharpcompress/files/13423180/03069284-040101.tgz)
claunia added the bugquestionup for grabs labels 2026-01-29 22:14:24 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#601