Re: [bds 2006] Decompress .gz files with zlib unit?
- From: Wolfgang.Ehrhardt.PLEASE.REMOVE@xxxxxxxxxxxxxxxxx (Wolfgang Ehrhardt)
- Date: Tue, 24 Jan 2006 19:25:02 GMT
On Tue, 24 Jan 2006 11:33:09 -0500, "Richard A. DeVenezia"
<rdevenezia@xxxxxxxxxxxx> wrote:
>Haven't used Delphi in ages, starting back up with bds 2006.
>
>I have a bunch of .gz files that need to be decompressed (on the fly) before
>I can use the data inside them.
>
>The files are not corrupt -- WinZip was unable decompress them.
>
>The simple console program below raises an Application Error dialog
> "The exception unknown software exception (0x0eedfade) occurred in the
>application at location 0x7c59bc3f"
>and writes out
> Exception ECompressionError in module Project2.exe at 00010AA7.
> Error.
>
>Have I missed something?
>Do I need a different decompression library ?
>
gz files (normally) are gzip compressed files. The gzip stream format
is slightly different from plain zlib streams, although gzip I/O can
be implemented with zlib, as it is shown with the gzio.c file in the
zlib distribution. zlib versions newer that 1.1.4 have enhanced gzip
support.
All versions of Delphi (that I know of) do have a "own" (sub-optimal)
interface to zlib. Delphi uses the C compiled obj files (and gzio.obj
is missing), but there are source code ports from c to pascal/delphi.
e.g. my own V1.1.4 (tested up to Delphi 9 aka 2005)
<http://home.netsurf.de/wolfgang.ehrhardt/zlibw114_2005-08-03.zip>
it based on Jacques Nomssi Nzali's Pascal port of zlib 1.1.2 available
from <http://www.nomssi.de/paszlib/paszlib.html> (beware of some
bugs!)
Another way of decompressing the gz files is: spawning gzip.exe either
to directly unpack file.ext.gz to file.ext or using the -c option to
redirect to stdout.
Hope that helps
Wolfgang
--
In order to e-mail me a reply to this message, you will have
to remove PLEASE.REMOVE from the address shown in the header
or get it from http://home.netsurf.de/wolfgang.ehrhardt
(Free AES, CRC, Hash, and HMAC source for Pascal/Delphi)
.
- Follow-Ups:
- Re: [bds 2006] Decompress .gz files with zlib unit?
- From: Richard A. DeVenezia
- Re: [bds 2006] Decompress .gz files with zlib unit?
- References:
- [bds 2006] Decompress .gz files with zlib unit?
- From: Richard A. DeVenezia
- [bds 2006] Decompress .gz files with zlib unit?
- Prev by Date: Re: [bds 2006] Decompress .gz files with zlib unit?
- Next by Date: Re: [bds 2006] Decompress .gz files with zlib unit?
- Previous by thread: Re: [bds 2006] Decompress .gz files with zlib unit?
- Next by thread: Re: [bds 2006] Decompress .gz files with zlib unit?
- Index(es):
Relevant Pages
|