Any idea how I can do this? I am able to compress a single file.
Asked
Active
Viewed 7,947 times
2
-
Most likely C#: [System.IO.Compression.GZipStream](http://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx). – cdhowie Nov 22 '10 at 14:50
2 Answers
3
You cannot GZip an entire folder directly, since GZip operates on a single stream of data. You will first have to turn the folder into such a stream.
One way to do this would be to create a Tar archive from the directory. This will give you a single stream to work on, and since the Tar format is not compressed, GZip will usually achieve good compression ratios on Tar files.

cdhowie
- 158,093
- 24
- 286
- 300
1
GZip doesn't support multiple files. They have to be combined in another container first like Tar. If you need full Zip support for C# use this library:

Samuel Neff
- 73,278
- 17
- 138
- 182