Home > Archive > Compression > April 2008 > zlib.dll
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| herrmie@googlemail.com 2008-04-02, 3:59 am |
| Hello,
I use the zlib.dll to uncompress zip, tgz, and gz files. But now I
have a real big problem.
To uncompress gz files I use the function uncompress from the
zlib.dll. It works with tgz files very well, but when I want to
uncompress an gz file, it doesn't work. It writes 11 Bytes to the file
and the rest of the filesize of the compressed file is with 0 bytes. I
use for the uncompress of gz file also the uncompress function from
the zlib.dll. But Now I found, that there is another function called
gzgetc. Maybe I have to use this? But it is very strange that it works
with tgz files.
Maybe someone of you have a code sample to uncompress a gz file?
Thanks a lot
kind regards
herrmie
| |
| Mark Adler 2008-04-02, 7:03 pm |
| On Apr 2, 12:43=A0am, "herr...@googlemail.com" <herr...@googlemail.com>
wrote:
> To uncompress gz files I use the function uncompress from the
> zlib.dll. It works with tgz files very well, but when I want to
> uncompress an gz file, it doesn't work.
The uncompress() function in zlib does not work on gz or tgz files.
It only works on zlib files. You need to read zlib.h to know what all
the functions do so you can picks the right ones. You can use the gz*
functions to work directly on gz files, or the inflate* functions with
the proper options to work on gzip data in memory.
Even when you do use the correct functions to decompress gz files,
decompressing a tgz file results in a tar file, which you then have to
process further to extract the files within. zlib does not provide
tar extraction.
Mark
| |
| herrmie@googlemail.com 2008-04-03, 3:57 am |
| On 2 Apr., 15:23, Mark Adler <mad...@alumni.caltech.edu> wrote:
> On Apr 2, 12:43 am, "herr...@googlemail.com" <herr...@googlemail.com>
> wrote:
>
>
> The uncompress() function in zlib does not work on gz or tgz files.
> It only works on zlib files. You need to read zlib.h to know what all
> the functions do so you can picks the right ones. You can use the gz*
> functions to work directly on gz files, or the inflate* functions with
> the proper options to work on gzip data in memory.
>
> Even when you do use the correct functions to decompress gz files,
> decompressing a tgz file results in a tar file, which you then have to
> process further to extract the files within. zlib does not provide
> tar extraction.
>
> Mark
Good Morning Mark,
I use the uncompress function for tgz files and it works very well.
And I use also the uncompress function for gz files, but some files
can be decompressed and other files not. By the way, in the file,
which doesn't work are not the data I want, it's byte crap. Anyway, I
have a look on the gz* functions and maybe I will find a solution. :)
Thanks for helping.
kind regards
Steffen
| |
|
|
|
|
|