[fpc-pascal] How to duplicate PHP's gzcompress() function in FPC?
skalogryz.lists at gmail.com
Wed Oct 7 17:51:33 CEST 2015
Not sure about, if there's an equivalent function, but the difference with
Gzip and Deflate is the following.
Gzip contains an information about the original file + deflate (compressed)
stream of data.
Default is just stream of data.
For example ZIP files are using Deflate, but not using Gzip headers
(providing their owns).
The difference is mentioned in deflateInit2() functions, where a user can
specify windowBits. If the value is negative, to Gzip header would be
I presume the gzcompress is passing negative value to the function, while
gzencode passes a positive value to the function.
On Wed, Oct 7, 2015 at 11:26 AM, Graeme Geldenhuys <
mailinglists at geldenhuys.co.uk> wrote:
> I need to compress a file the same way as PHP's gzcompress() function:
> From that URL it uses ZLIB, and that is apparently different to GZIP and
> DEFLATE, because PHP also has a gzencode() and gzdeflate() functions
> It seems the key point, from want I understand in the URL text, is that
> ZLIB compresses the data and has no Header Information, where GZIP does
> similar, but has Header Information.
> I'm still unclear as to the the differences between ZLIB and DEFLATE - I
> always assumed them to be the same thing.
> Anyway, so what is the equivalent to gzcompress in FPC? I see in the FCL
> there is a zlib.pp unit, but in the code comments in takes about
> wrapping the compressed data with gzip. So I'm not sure if this is then
> equivalent to PHP's gzcompress().
> - Graeme -
> fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
> My public PGP key: http://tinyurl.com/graeme-pgp
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal