[fpc-pascal] How to duplicate PHP's gzcompress() function in FPC?

2015-10-07 Thread Graeme Geldenhuys
Hi, I need to compress a file the same way as PHP's gzcompress() function: http://php.net/manual/en/function.gzcompress.php >From that URL it uses ZLIB, and that is apparently different to GZIP and DEFLATE, because PHP also has a gzencode() and gzdeflate() functions respectively. It seems

Re: [fpc-pascal] How to duplicate PHP's gzcompress() function in FPC?

2015-10-07 Thread Graeme Geldenhuys
On 2015-10-07 16:51, Dmitry Boyarintsev wrote: > The difference is mentioned in deflateInit2() functions, where a user can > specify windowBits. If the value is negative, to Gzip header would be > generated. > > I presume the gzcompress is passing negative value to the function, while > gzencode

Re: [fpc-pascal] How to duplicate PHP's gzcompress() function in FPC?

2015-10-07 Thread silvioprog
On Wed, Oct 7, 2015 at 12:26 PM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > Hi, > > I need to compress a file the same way as PHP's gzcompress() function: > >http://php.net/manual/en/function.gzcompress.php-pascal >

Re: [fpc-pascal] How to duplicate PHP's gzcompress() function in FPC?

2015-10-07 Thread Graeme Geldenhuys
On 2015-10-07 16:56, Graeme Geldenhuys wrote: > constructor has an option ASkipHeaders which defaults to False. I'm now > setting that parameter to True and will soon see if that works for my > code or not. That didn't work for my experiment. :-/ Regards, - Graeme - -- fpGUI Toolkit - a

Re: [fpc-pascal] How to duplicate PHP's gzcompress() function in FPC?

2015-10-07 Thread Dmitry Boyarintsev
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

Re: [fpc-pascal] How to duplicate PHP's gzcompress() function in FPC?

2015-10-07 Thread Graeme Geldenhuys
On 2015-10-07 17:22, Graeme Geldenhuys wrote: >> > constructor has an option ASkipHeaders which defaults to False. I'm now >> > setting that parameter to True and will soon see if that works for my >> > code or not. > That didn't work for my experiment. :-/ Correction, I made a silly mistake in

Re: [fpc-pascal] How to duplicate PHP's gzcompress() function in FPC?

2015-10-07 Thread silvioprog
On Wed, Oct 7, 2015 at 1:42 PM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: [...] > Correction, I made a silly mistake in my code. I've managed to get it to > work with TCompressionStream and with ASkipHeaders = False (the default). The link that I sent has a nice explanation (and