Zlib unable to decompress a gzip .gz file....?

BlitzMax Forums/BlitzMax Programming/Zlib unable to decompress a gzip .gz file....?

Arowx(Posted 2008) [#1]
Hi,

I've just found out that the uncompress method, once I had worked out how to use it, does not work with gzip (.gz) files!

The Zlib Manual indicates it's possible to read a gzip file with the gzopen() and gzread() commands.

So has anyone managed to get these commands to work with the blitzmax Zlib module?

And more importantly have a simple code example to help me get started!

Regards

Merx


Arowx(Posted 2008) [#2]
Found this Module Tweak now I'm off to see if I can get it to work... but if you have a working example please let me know!


Arowx(Posted 2008) [#3]
Well one step forward!

Using the module tweak above I have unzipped a gzip file!



But as I am downloading files using FTP via BaH.libcurlssl the next level is to work out how to unzip a bank or stream of data...!

All working examples welcome! ;o)


Arowx(Posted 2008) [#4]
Got it wow forgot how gnarly c code can be and how hard technical documents can be to read through...

OK Zlib does support gzip format you either need to use it's nice file gzip functions as per previous post or start getting a little bit more indepth with the inflateInit2() parameters!

But I have managed to write a little wrapper c code that does all the work for you!

*** Warning this is a work in progress ***!

This is the way I have done it...

1. drop gzWrap.c file in with the zlib.mod folder

2. update the zlib.bmx file to include it and add the functionality

3. Rebuild modules

4. Run the following test code with a valid test.gz file


I still need to get it working in a nice buffered manner!

Any and all suggestions welcome!

Regards

Merx


deps(Posted 2009) [#5]
Works like a charm and exactly was I was looking for! Thanks a lot. :)
(And sorry for the thread necromancy...)