Failed to extract .tar.gz file #371

Open
opened 2026-01-29 22:10:49 +00:00 by claunia · 1 comment
Owner

Originally created by @fabriciasantos on GitHub (Aug 29, 2019).

I am trying to extract a .tar.gz file and it throws an exception such as:

image

Value cannot be null.
Parameter Name: path2

Code:
var file = @"C:\data\base.tar.gz";
var file = @"C:\data\base.tar.gz";
var caminhoArquivo = @"C:\data\teste\";
using (var stream = File.OpenRead(file))
{
using (var archive = ArchiveFactory.Open(stream))
{
var teste = archive.Entries.Count();
foreach (var entry in archive.Entries.Where(entry => !entry.IsDirectory))
{
entry.WriteToDirectory(caminhoArquivo, new ExtractionOptions()
{
ExtractFullPath = true,
Overwrite = true
});
}
}
}

Originally created by @fabriciasantos on GitHub (Aug 29, 2019). I am trying to extract a .tar.gz file and it throws an exception such as: ![image](https://user-images.githubusercontent.com/29304331/63947641-aa4d5c80-ca4d-11e9-98af-8802ff9efa28.png) _Value cannot be null. Parameter Name: path2_ Code: `var file = @"C:\data\base.tar.gz";` `var file = @"C:\data\base.tar.gz";` ` var caminhoArquivo = @"C:\data\teste\";` `using (var stream = File.OpenRead(file))` `{` `using (var archive = ArchiveFactory.Open(stream))` `{` ` var teste = archive.Entries.Count();` `foreach (var entry in archive.Entries.Where(entry => !entry.IsDirectory))` `{` `entry.WriteToDirectory(caminhoArquivo, new ExtractionOptions()` `{` `ExtractFullPath = true,` `Overwrite = true` ` });` ` }` `}` `}`
Author
Owner

@turbolocust commented on GitHub (Jan 25, 2020):

Could you please provide the full stack trace as text? If possible, a copy of the archive file would also be great for further investigation.

@turbolocust commented on GitHub (Jan 25, 2020): Could you please provide the full stack trace as text? If possible, a copy of the archive file would also be great for further investigation.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#371