mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 05:25:00 +00:00
No exception with corrupt file #238
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @InBerg on GitHub (Sep 14, 2017).
Hi,
actualy we decompress our GZIP TAR file in C# with the command line tool "Tar.exe".
We start an process and parse the result of the command line.
I want to change this by unsing Sharpcomress.
We have sereval unit test for the decompression.
When I use Sharpcomeress to decompress one of the unit tests failed.
This test try to extract a corrupt TAR file.
The "Tar.exe" thorws an exception.
Sharpcomress decompress the file without an exception. Is this a known bug?
This is the code I use to decompress the attached file:
public bool Extract(string filename, string extractPath)
{
try
{
using (Stream stream = File.OpenRead(filename))
{
var reader = ReaderFactory.Open(stream);
reader.WriteAllToDirectory(extractPath, new ExtractionOptions { ExtractFullPath = true, Overwrite = true });
}
return true;
}
catch (Exception e)
{
Console.WriteLine(e);
return false;
}
}
Kind regards Mike
20150427_140120_f4_3d_80_00_01_6e.zip
@adamhathcock commented on GitHub (Sep 14, 2017):
SharpCompress does not do any validation of CRCs that GZip or whatever might have. The extraction will look successful. It's not a bug but the lack of a CRC validation feature.
@InBerg commented on GitHub (Sep 15, 2017):
The TAR.exe say this:
tar -tf 20150427_140120_f4_3d_80_00_01_6e.scd1
Warning: non-standard extension used on a compressed archive.
Exception: System.Exception: header checksum is invalid.
bei Ionic.Tar._internal_ListOrExtract(String archive, Boolean wantExtract)
bei Ionic.TarApp.ListContents()
bei Ionic.TarApp.Main(String[] args)
Is it possible to make this to a feature request?
Tar.zip
@adamhathcock commented on GitHub (Sep 15, 2017):
It is possible. CRC is already a known missing feature. I'm accepting pull requests if you'd like to do it.
@InBerg commented on GitHub (Sep 15, 2017):
How can I do that?