Questions tagged [sharpziplib]

#ziplib (SharpZipLib) is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform.

The #ziplib (SharpZipLib) is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform. It is implemented as an assembly (installable in the GAC), and thus can easily be incorporated into other projects (in any .NET language). The creator of #ziplib put it this way: "I've ported the zip library over to C# because I needed gzip/zip compression and I didn't want to use libzip.dll or something like this. I want all in pure C#."

Reference: http://www.icsharpcode.net/opensource/sharpziplib/

Installation

SharpZipLib can most easily be installed through its NuGet package.

Install-Package SharpZipLib
272 questions
8
votes
3 answers

How do you add a folder to a zip archive with ICSharpCode.SharpZipLib

I have to create two folders inside of a zip file that I create programmatically using ICSharpCode.SharZipLib.Zip. I want to: private void AddToZipStream(byte[] inputStream, ZipOutputStream zipStream, string fileName, string fileExtension) …
Saturn K
  • 2,705
  • 4
  • 26
  • 38
7
votes
2 answers

lastwritetime is changing while extracting a zipfile in c#?

I am using Sharpziplib version 0.86 to extract a zip file. It is working fine but while extracting a winzip file through code,Lastwritetime is changing in seconds... Have used this also File.SetLastWriteTime(fullPath, theEntry.DateTime); Actual…
bala3569
  • 10,832
  • 28
  • 102
  • 146
7
votes
1 answer

C# with SharpZipLib - Compatibility of SharpZipLib with Winzip and XP?

I am using the CSharpZipLib library to automatically zip some files. The problem is that the resulting zip file doesn't work with Winzip (version 8.1) or XP's compressed folders. It does work with 7zip. Winzip gives an error that this file is not…
John M
  • 14,338
  • 29
  • 91
  • 143
7
votes
7 answers

c# sharpziplib adding file to existing archive

am trying to add a file to an existing archive using the following code. When run no errors or exceptions are shown but no files are added to the archive either. Any ideas why? using (FileStream fileStream = File.Open(archivePath,…
Grant
  • 11,138
  • 32
  • 94
  • 140
6
votes
1 answer

SharpZipLib : Compressing a single file to a single compressed file

I am currently working with SharpZipLib under .NET 2.0 and via this I need to compress a single file to a single compressed archive. In order to do this I am currently using the following: string tempFilePath =…
MrEyes
  • 13,059
  • 10
  • 48
  • 68
6
votes
1 answer

What's wrong with my application ---- Size was 0, but I expected 46806 !

I'm a C# programmer. Now, I'm using the ICSharpCode.SharpZipLib.dll to create a zip file in my current project. But it occurs to me that when I click the button at the SECOND TIME to execute a function to create a zip file, the application will…
user412681
  • 61
  • 2
6
votes
2 answers

Decompressing .bz2 stream to file in C#

I'm having real trouble trying to use the .bz2 stuff from the SharpZipLib library and I've not been able to find any help else where. Any help or advice would be much appreciated and if anyone can point me at an existing solution I can learn from…
Mandatory
  • 63
  • 1
  • 3
6
votes
1 answer

Make a .tar.gz archive without folder structure using SharpZipLib

I am trying to .tar.gz a list of files from a folder using SharpZipLib. The problem is no matter how pass the files paths - the result always contains the files paths - and not only the files thems selves. What am i missing here? string filesFolder…
kiki
  • 323
  • 2
  • 5
  • 11
5
votes
2 answers

Is there a library to unzip .Z files using VB.NET?

I need to unzip a list of .Z files which will be kept in a folder using Visual Basic.NET. For example, consider that there is a folder like C:\FilesToBeUnzipped. Inside this folder there will some 5 to 6 files with .Z as extension. I need to unzip…
5
votes
3 answers

SharpZipLib - ZipException "System.ArgumentOutOfRangeException" - Why am I getting this exception?

I'm using SharpZipLib to unzip files. My code has been working nicely for all zipfiles except the zip file what i am extracting now... Got this exception: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid…
bala3569
  • 10,832
  • 28
  • 102
  • 146
5
votes
1 answer

In PHP, each character in decompressed gz string is followed by ^@, why?

I'm sending over a gzipped string from C# (using SharpZipLib) to PHP where I decompress with readgzfile. This works, however each character in the string is followed by two strange characters (using vim in the console those are displayed as ^@). I…
Whiskey
  • 262
  • 3
  • 15
5
votes
1 answer

Which compression type should i choose in SharpZipLib?

I have a File Transfer Application that sends files and folders. (Server - client) I am trying to send data over TCP (sockets), I've made some rules for the way of transferring the data, so if it's sending a large folder that has many files, it…
Murhaf Sousli
  • 12,622
  • 20
  • 119
  • 185
4
votes
2 answers

Create zip from multiple files in memory

I am trying to use SharpZipLib to generate zip file and let the client download it. Currently zip folder is created and available on client machine but the issue is download.zip folder is blank. The files which are specified in a folder are not…
riya
  • 115
  • 2
  • 3
  • 6
4
votes
3 answers

How to use ICSharpCode.ZipLib with stream?

I'm very sorry for the conservative title and my question itself,but I'm lost. The samples provided with ICsharpCode.ZipLib doesn't include what I'm searching for. I want to decompress a byte[] by putting it in…
Ivan Prodanov
  • 34,634
  • 78
  • 176
  • 248
4
votes
3 answers

Is it safe to call ICsharpCode.SharpZipLib in parallel on multiple threads

We are currently using for compression the GZipOutputStream class of ICsharpCode.SharpZipLib library. We do it from a single thread. I want to split my input data stream into chunks and compress them in parallel. I'm worried though that this…
farfareast
  • 2,179
  • 1
  • 23
  • 22
1
2
3
18 19