Click here to Skip to main content
15,917,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everyone,

I am working on some zipped files which I have in my hard disk. I have used the Ionic.Zip to extract all the zip files to my directory in order to read them. But this is taking too long as I suppose File IO takes a hell of a lot of time.

So I tried using Memory mapped files in order to make the process faster so that I can extract the files on the virtual memory, but this didn't work as zip1.ExtractAll(Destination_path); requires a destination path and I cant get one for the memory mapped files.

So I tried reading the zipped files into stream(using Gzip Library) but I keep on getting the error "The magic number in GZip header is not correct. Make sure you are passing in a GZip stream."

My Question is : Is there any way I can reduce the amount of time taken to extract the files on my hard disk or is there any way I dont have to extract and get all the information?Please let me know if someone knows the answer.

Please note my application is windows based.
Thanks
Posted
Updated 14-Sep-12 7:58am
v3
Comments
GB_1114 22-Sep-12 18:08pm    
Hello Again, i have been using the DotNetZip Library to unzip the files to a destination folder,but the p[process is too slow, can anyone suggest me any faster way to do so. the code I am using is :
using(var zip = Ionic.Zip.ZipFile.Read(Filename))
{
zip.ExtarctAll(DestinationFolderPath);
}
This takes a hell of a lot of time, as I am unzipping around 2200 files Can anyone suggest a faster way to do so. I used memory mapping, but I cant find the path of the memorymappedfile so that I can extract the files over there.

 
Share this answer
 
v2
Comments
GB_1114 14-Sep-12 13:55pm    
Hi Thanks for your reply, I checked some of the codes, but most of them seem to work with ASP.Net, my application is just Windows based, can you suggest something for that?
Sergey Alexandrovich Kryukov 14-Sep-12 16:46pm    
No, SharpZipLib has nothing to do with ASP.NET, apparently. You looked at some wrong place, probably some usage samples. I have no idea why they were related to ASP.NET.
--SA
Sergey Alexandrovich Kryukov 14-Sep-12 16:50pm    
My 5. Another powerful alternative is 7-zip. Please see my answer.
--SA
GB_1114 14-Sep-12 18:19pm    
Thanks a lot Program_Fox and and Sergey for your replies..wil definitely look into this..:))
Sergey Alexandrovich Kryukov 15-Sep-12 20:27pm    
You are welcome. Well you formally accept our answers (green button)? -- thanks.
--SA
In alternative to #ziplib mentioned in Solution 1, you can use SevenZipSharp, a .NET wrapper of the famous 7-Zip:
http://en.wikipedia.org/wiki/7-Zip[^],
http://sevenzipsharp.codeplex.com/[^].

Both ZIP libraries are open-source. (And having nothing to do with ASP.NET :-))

—SA
 
Share this answer
 
Comments
Espen Harlinn 15-Sep-12 11:53am    
5'ed!
Sergey Alexandrovich Kryukov 15-Sep-12 20:25pm    
Thank you, Espen.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900