Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unzip 4gb file in c#

I am using sharp lib for zip and unzip. It works fine upto 4GB file so looking for some .net framework solution. I tried Gzipcompression in dotnet. That too fails to uncompress 4gb files. Do you know any other zip library which handles large files.

Thanks

like image 960
dps123 Avatar asked Dec 12 '22 16:12

dps123


2 Answers

DotNetZip will handle ZIP64 archives (>4.2GB) correctly, in 100% managed code. It also (from my testing) has a dramatically better feature set and does a better job than the framework libraries for compression (ie: equal or better perf. with much smaller files - often about 1/3rd the size of the framework's compression routines).

like image 107
Reed Copsey Avatar answered Dec 28 '22 02:12

Reed Copsey


The 4 Gb limitation was removed in .NET 4.0, so you can use the classes in System.IO.Compression namespace.

The compression algorithms in System.IO.Compression have been improved in .NET 4. DeflateStream and GZipStream no longer inflate already compressed data. This means that in many cases you’ll see better compression ratios when using these streams on .NET 4. We’ve also removed the 4 GB size limit, so you can now compress streams over 4 GB in length.

From: What's New in BCL

If you cannot target the .NET 4.0 framework then I'm afraid I can't be of any assistance.

like image 44
João Angelo Avatar answered Dec 28 '22 01:12

João Angelo