I'm hoping someone can shed some light on how to decompress the files that I compressed and saved to disk. I used Compress::Zlib::memGzip to compress them but cannot seem to open them and decompress to their normal state.
I've tried every possible way I can come up with, including gzopen() and Compress::Zlib::memGunzip :(
Here is the relevant code used to compress and save to disk:
require Compress::Zlib;
my $new_content = Compress::Zlib::memGzip($content);
if (defined $new_content) {
$response->content($new_content);
$response->content_length(length $new_content);
$response->content_encoding("gzip");
open LOG, ">>search/$docid" or die "Can't append-open $docid: $!";
select(LOG);
$¦ = 1; # Make LOG unbuffered
print LOG $content; Thanks for any help!
Birdman
Yes on both of your questions. So you are saying I did it wrong from the beginning and I'll need to delete the files and start again, using binmode() before the save to disk?
When I first wrote the script that saves the compressed files, I tested decompressing using Compress::Zlib::memGunzip and it worked fine while it was in-memory. I never even considered that things would change after it was saved and reopened.
Birdman