Re: deflate parts of a file



"sid" <sridhara@xxxxxxxxx> wrote in message
news:1151596999.818114.126060@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I need to compress parts of a file, say some sections of an xml file
while leaving others as ASCII on the ouput stream. I took the deflate
example from cpan

Which deflate example are you referring to?

and started gathering all lines of a section in a
string and then doing one deflate, ouput, flush and output the
compressed section. But this doesn't seem to be working. I am seeing
"use of uninitialized values" warnings and the final output file
doesn't look right.
I would see some compressed data then a whole bunch
of xml without any compressed data in between and so forth.

Can you post some code please?

The
compress method has a horrible performance. It actually made the file
much bigger.
Hence I only want to use the deflate method. It works fine
on the whole file.

Compression isn't worth the effort on small strings. Ending up with
something bigger is one of the main reasons for not doing it.

But I want to use it on sections of a file. Are
there examples that someone can point me to?

Paul


.



Relevant Pages

  • Re: deflate parts of a file
    ... or die "Cannot create a deflation stream\n"; ... set output to compressed string using deflate procedre ... compress method has a horrible performance. ...
    (comp.lang.perl.misc)
  • deflate parts of a file
    ... I need to compress parts of a file, say some sections of an xml file ... while leaving others as ASCII on the ouput stream. ... string and then doing one deflate, ouput, flush and output the ...
    (comp.lang.perl.misc)
  • Re: zlib on Palm OS PDA and PHP web server
    ... me an error when I try to decompress/deflate the data. ... name) and getting a zlib stream instead, or b) the data is corrupted ... There is no standard for how a deflator must compress. ... compressuses deflate(). ...
    (comp.compression)
  • Re: WriteStream to ReadStream adaptor?
    ... deflate:= DeflateStream on: x readStream. ... That way you can manage how to feed it the contents to compress. ... compressed:= compressed contents readStream. ... And let's use a bag so that we don't need to build the 1M string: ...
    (comp.lang.smalltalk)
  • Re: blocking records with zlib and Z_SYNC_FLUSH
    ... deflate operation and just use compress() to recompress the block once ... And only if it doesn't fit that way would I need ... which takes at most three deflate passes. ...
    (comp.compression)