Quantcast
Channel: SharpDevelop Community
Viewing all articles
Browse latest Browse all 1764

Header Checksum Is Invalid

$
0
0

Hi ,

 I am trying to unzip a *.tbz file on my windows machine. THis is the decription of the file -  The feed files are archived into binary files in a compressed PKZip (WinZip) format. The compressed file is named according to the following template:

iYYYYMMDDHH.zip
pYYYYMMDDHH.zip
mYYYYMMDDHH.zip

Here is the code whcih I am using -

            DirectoryInfo dic = new DirectoryInfo(@"C:\AppleStuff\AllFiles\");

            FileInfo[ files = dic.GetFiles("*.tbz", SearchOption.AllDirectories);

            string ExtractedFolder = @"C:\AppleStuff\Extracted";

            foreach (FileInfo file in files)
            {

                Stream inStream = File.OpenRead(file.FullName);

                TarArchive tarArchive = TarArchive.CreateInputTarArchive(new BZip2InputStream(inStream));
                tarArchive.ExtractContents(ExtractedFolder);
                tarArchive.Close();               

                inStream.Close();
            }

at TarArchive.ExtractContents I keep on getting the    "ICSharpCode.SharpZipLib.Tar.TarException: 'Header checksum is invalid' exception. Its being thrown at -  ICSharpCode.SharpZipLib.Tar.TarInputStream.GetNextEntry()

 

 Any idea what might be going wrong ?

 

 

 

 


Viewing all articles
Browse latest Browse all 1764

Trending Articles