tags:

views:

48

answers:

1

Hi,

I need to implement a C routine to (un)compress files in gzip format.

Can anyone give me an example?

I tried zlib, but it not seems compatible.

Thanks.

+5  A: 

zlib is completely compatible with gzip files, but you do need to be sure that you are using the gzip-oriented functions, because gzip has a special header and footer format that will otherwise not be interpreted correctly by zlib: http://www.zlib.net/manual.html#Gzip

If this doesn't work for you, then you need to investigate if what you have are really gzip files and not some other form of compression with a misleading file extension.

Tyler McHenry