>>>>> "JSA" == John SJ Anderson <genehack@genehack.org> writes:
>> Is there a preferred way to append a text file to the end of gzipped
>> file? the api of File::Slurp append_file is nice, but doesn't work
>> with gzip file...
JSA> The concatenation of two gzip'ed files is a valid gzip file, which
JSA> when ungzip'd will produce a single file containing the contents of
JSA> the first followed by the contents of the second -- so just gzip the
JSA> stuff you want to append and concatenate the files together.
that means append_file can be used. to correct one thing i forgot in my
other post, you need to set binmode => ':raw' for that to work on
windows due to line endings. so this (again rough code) should be close
to what is needed:
append_file( $file, { binmode => ':raw' }, compress $append_text ) ;
that assumes compress is an imported gzip function. edit as needed.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
Thread Previous
|
Thread Next