adamhathcock / sharpcompress

SharpCompress is a fully managed C# library to deal with many compression types and formats.
MIT License
2.29k stars 482 forks source link

Can not open tgz file #782

Open Broeckl opened 1 year ago

Broeckl commented 1 year ago

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