problem about using zlib to uncompress gzip in memory
I wrote a function which for uncompressing data for gzip or deflate format using zlib,see followed code;
source param is pointed to the compressed data,len param is the size of compressed data,
dest param is for returning the address which pointed to the uncompressed data;the last gzip param tell the function
if the data is compressed by deflate format or gzip format;
currently,the function only work for uncompressing data which is compressed by deflate format;
a Z_DATA_ERROR would be returned if uncompressing gzip data;
anything did I miss? what's wrong?
any help is appreciated!
debian:~# uname -a
Linux debian 2.6.18-3-686 #1 SMP Thu Nov 23 20:49:23 UTC 2006 i686 GNU/Linux
debian:~# apt-cache show zlib1g-dev
Package: zlib1g-dev
Priority: optional
Section: libdevel
Installed-Size: 580
Maintainer: Mark Brown <broonie@debian.org>
Architecture: i386
Source: zlib
Version: 1:1.2.3-13
Provides: libz-dev
Depends: zlib1g (= 1:1.2.3-13), libc6-dev | libc-dev
Conflicts: zlib1-dev
Filename: pool/main/z/zlib/zlib1g-dev_1.2.3-13_i386.deb
Size: 406222
MD5sum: 144bb30c39b0dfde9c82986eeee27d14
SHA1: 3e1603e995f9fdf432e64bbc850ba8d59f18a4ed
SHA256: cdf5272f6c40abd23ab807135cf2d9a3fe0fc4fc3398861e7aa59287e72450c7
Description: compression library - development
zlib is a library implementing the deflate compression method found
in gzip and PKZIP. This package includes the development support
files.
Tag: devel::library, role::devel-lib, use::compressing
Hello I have been trying to compile glib 2.28 with needs Zlib. During the compilation process I received these messages
Then giving a look at the configure of Zlib, there was an option to static link it and I obviously used it.
So I think I can solve it by compiling a shared zlib, or by... (4 Replies)
Hi,
I need to uncompress a gzip and bzip file using java on unix solaris environment. I also need to retreive the header information of the file inorder to differentiate between gzip and bzip file. Please help
Pooja (0 Replies)
Hi Guys,
I have a few files. i want to tar these files and zip it using gzip it.
-rw-r----- 1 magesh magesh 12940369 Jul 27 09:26 dcx_imds_c.asc
-rw-r----- 1 magesh magesh 1221391 Jul 27 09:27 dcx_imds_h.asc
-rw-r----- 1 magesh magesh 1105673 Jul 27 09:27... (6 Replies)
Hi,
I am quite new to unix.
I need to do the following using gzip.
a file suppose abc.gz is in the directory.
I need to uncompress it and rename the uncompressed file to ecoes.dat.
can anyon please help me in this regard?? (4 Replies)
I am using the ZLIB_VERSION "1.2.3" . The memory requirement for Zlib/GZIP compression is stated as
/* The memory requirements for deflate are (in bytes):
(1 << (windowBits+2)) + (1 << (memLevel+9))
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
... (0 Replies)
Currently I am using the ZLIB_VERSION "1.2.3" . The memory requirement for Zlib/GZIP compression is stated as
/* The memory requirements for deflate are (in bytes):
(1 << (windowBits+2)) + (1 << (memLevel+9))
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default... (0 Replies)
Hi All,
I am zipping a file using
gzip -cq XYZ.txt > XYZ.txt.gz command.
file got created with name XYZ.txt.gz
but when i execute the following command i am getting errors,
$ gzip -t XYZ.txt.gz
gzip: XYZ.txt.gz: invalid compressed data--crc error
gzip: XYZ.txt.gz: invalid... (6 Replies)
When I gzopen & gzread from a gzip file, it works OK. But I when I try to uncompress the same data from memory (either by reading to memory with fread or mmap()ing) using decompress, I get Z_DATA_ERROR. Is it because gzip file has some kind of headers that uncompress doesn't want?
How can I get... (3 Replies)
Hi, I try to marshal a unsigned int and a char * into a buffer, and then unmarshal them later to get them out. I need to put the char * in the front and unsigned int at the end of the buffer. However, my system always give me "BUS ERROR". I am using Sun Sparcs Sloris 2.10.
My code to marshal... (6 Replies)
I hope someone can help me on this little problem.
Bit of background first. I've dumped an Oracle database to a plain text file that I wish to gzip then transfer via ftp to another machine. The dump and gzip runs fine and if I gunzip the file while still in unix the file looks fine. The... (2 Replies)