zlib

How can I compress a char array into a compressed html page using Zlib

I have a CGI application in C that creates an html page by saving a char* as a html page: void saveTextFile(const char *filename, const char *str){.......} called as saveTextFile("..\\index.html",outputFile); How do I use zlib to take as input the "outputFile" char array and output a zipped html page with appropriate headers? Wo...

DotZlib - Inflate error handling code 1 Z_STREAM_END

Hi, I am using a slightly modified version of the DotZlib which is part of the contrib directory with the zlib source code to inflate a realtime data stream. Instead of the regular inflateInit I need to use InflateInit2 - but this the only difference to the provided library. Netherlesse after a couple of reads I receive error code 1 fr...

Can zlib-compressed string contain whitespace?

Can zlib-compressed string contain whitespace? By whitespace I mean ' ', \n, \t. ...

Zlib in database - Django

When I try to put a zlibbed string in models.TextField >>> f = VCFile(head = 'blahblah'.encode('zlib')) >>> f.save() it fails: ... raise DjangoUnicodeDecodeError(s, *e.args) DjangoUnicodeDecodeError: 'utf8' codec can't decode byte 0x9c in position 1: unexpected code byte. You passed in 'x\x9cK\xcaI\xccH\x02b\x00\x0eP\x03/' (<type...

PHP Zip extractTo - problem with permissions

Hi I'm trying to unzip a Zip archive in PHP using extractTo. The PHP script is running via the webbrowser i.e. as "nobody". The script: 1) creates a new subdirectory (e.g. "abc"), with permissions 0777 and owner "nobody" under document root (i.e. one level above public_html) 2) copies the Zip file (from an incoming FTP directory und...

Interfacing zlib with ActiveTcl 8.5?

I'm trying to use the zlib extension in ActiveTcl 8.5 in order to save out a compressed blob to a file. Both ActiveTcl 8.5.5 and 8.5.6 on win32 have a zlibtcl 1.2.3 extension. I've tried both: package require zlibtcl and load zlibtcl123.dll Which both seem to indicate that the extension is properly loaded. However, I can't seem ...

Get size of uncompressed data in zlib?

I'm creating something that includes a file upload service of sorts, and I need to store data compressed with zlib's compress() function. I send it across the internet already compressed, but I need to know the uncompressed file size on the remote server. Is there any way I can figure out this information without uncompress()ing the data...

I get this error when installing a gem: "ERROR: While executing gem ... (Zlib::GzipFile::Error)"

When installing a gem on my system, I get the following error: gem install blackbook --version ">= 1.0.7" --source http://github.com/tamoyal/blackbook/tree/master ERROR: While executing gem ... (Zlib::GzipFile::Error) not in gzip format Any ideas as to why this is happening? I built the gem so maybe it is something wrong with my...

ZLIB on Windows: gzopen/gzwrite/gzclose produces castrated output file / antivirus at fault?

I've been chasing a very mysterious bug for days now, which seems to revolve around the (ZLIB library); it occurs once every month or so, and only on some specific production environments. Here is what the code does: The program calls gzopen to write to a file X. The program writes data to the file, doing several gzwrite. The program f...

Zlib in Delphi 2009

I am upgrading a app to Delphi 2009. The app uses Soap and we compress the soap request and response streams using Zlib. This works fine in Delphi 2006 but not in Delphi 2009. So I went back to Delphi 2006 and changed to use FastZlib. It all worked fine in Delphi2006 but does not work in Delphi 2009 and I get Decompress errors. Has any...

maven-war-plugin vs. "Unexpected end of ZLIB input stream"

im using maven-war-plugin and sometimes i get Unexpected end of ZLIB input stream when deploying to jboss, its because file is made in jboss directory and not moved/copied there, is there any way to fix it(using maven)? my configuration: <build> <plugins> <plugin> <artifactId>maven-war-plugin</artifactId> <configur...

zlib on z/OS USS

Hi all, Im trying to compile z/lib on z/OS USS(thats right a mainframe). ive got gmake and the c89 compiler (which im assuming is c89 standards compliant) and USS is supposed to be POSIX compliant. But zlib seems to be tripping up on struct internal_state FAR *state; /* not visible by applications */ with the following error(s) c8...

Python: Inflate and Deflate implementations

I am interfacing with a server that requires that data sent to it is compressed with Deflate algorithm (Huffman encoding + LZ77) and also sends data that I need to Inflate. I know that Python includes Zlib, and that the C libraries in Zlib support calls to Inflate and Deflate, but these apparently are not provided by the Python Zlib m...

PHP gzcompress vs gzopen/gzwrite

I'm writing a PHP script that generates gzipped files. The approach I've been using is to build up a string in PHP and gzcompress() the string before writing it out to a file at the end of the script. Now I'm testing my script with larger files and running into memory allocation errors. It seems that the result string is becoming too la...

C/C++ Packing and Compression

Hey guys, I'm working on a commercial project that requires a couple of files to be bundled (packed) into an archive and then compressed. Right now we have zlib in our utility library, but it doesn't look like zlib has the functionality to compress multiple files into one archive. Anyone know of free libraries I'd be able to use for thi...

Unzipping a directory in C++

I am creating a C++ program that will read a .docx's plain text. My plan of attack is to rename the .docx as a .zip and then unzip. I then will rename the .xml file containing the text of the document as a .txt and parse it out. Right now I have figured out the renaming which was easy enough. I am now struggling with unzipping. I am...

has anyone tried installing ruby & rubygems from source on ubuntu (preferably unbuntu 9)?

The Ruby on Rails website recommends installing Ruby from source under Linux. I encountered a number of C library problems building ruby from source on a clean install of Unbuntu 9. All the instructions I found on the net about installing ruby on ubuntu have involved using the prepackaged (.deb-based) ruby. Clearly this isn't what the r...

Can I uncompress .NET GZipStream using zlib?

Can I uncompress a bytestream that was compressed using the .NET GZipStream using the zlib library in C++? ...

zlib decompression in python

Okay so I have some data streams compressed by python's (2.6) zlib.compress() function. When I try to decompress them, some of them won't decompress (zlib error -5, which seems to be a "buffer error", no idea what to make of that). At first, I thought I was done, but I realized that all the ones I couldn't decompress started with 0x78DA ...

ZLib decompression

I am trying to compress data using the zlib .net library. Regardless of the content of the uncompressed string I only seem to get two bytes of data in the raw[]. { string uncompressed = "1234567890"; byte[] data = UTF8Encoding.Default.GetBytes(uncompressed); MemoryStream input = new MemoryStream(data); MemoryStream out...