LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-14-2012, 10:04 AM   #16
Brandon9000
Member
 
Registered: Apr 2012
Location: Florida
Distribution: Many
Posts: 111

Original Poster
Rep: Reputation: Disabled

That seems like a really good tip, although it may take some re-reading to really understand it. It says:

"windowBits is passed < 0 to suppress zlib header"

Perhaps that is all I have to do to produce a true gzip format.
 
Old 09-15-2012, 07:59 AM   #17
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian
Posts: 2,396

Rep: Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814
Quote:
Originally Posted by Brandon9000 View Post
If that is what I have to do, I must say that the proper settings of the parameters to deflateInit2() to produce a gzip type header are not well documented. Something about adding 16 to windowsBits.
It's not "Something about adding 16", it's exactly adding 16. I don't understand why you say this is not well documented.

Quote:
Originally Posted by zlib Manual
Add 16 to windowBits to write a simple gzip header and trailer around the compressed data instead of a zlib wrapper.
 
Old 09-17-2012, 03:40 PM   #18
Brandon9000
Member
 
Registered: Apr 2012
Location: Florida
Distribution: Many
Posts: 111

Original Poster
Rep: Reputation: Disabled
Okay, then, could you post a link to the good documentation about how to choose the parameters to get deflateInit2 to produce gzip headers? For example, how do you choose the windows bits in the first place before you add the 16, and what should the other parameters be? Is there a source that explains the parameters in more than one sentence? Something like that and maybe a couple of examples would be what I would call good documentation.

Last edited by Brandon9000; 09-17-2012 at 03:45 PM.
 
Old 09-18-2012, 09:24 AM   #19
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian
Posts: 2,396

Rep: Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814
Quote:
Originally Posted by Brandon9000 View Post
Okay, then, could you post a link to the good documentation about how to choose the parameters to get deflateInit2 to produce gzip headers? For example, how do you choose the windows bits in the first place before you add the 16, and what should the other parameters be? Is there a source that explains the parameters in more than one sentence?
I just extracted the sentence relevant to the gzip headers from the zlib manual which contains all this information.

Quote:
Something like that and maybe a couple of examples would be what I would call good documentation.
Okay, the manual doesn't contain example usage, but the zlib distribution does come with source code for minigzip.
 
Old 09-18-2012, 09:29 AM   #20
Brandon9000
Member
 
Registered: Apr 2012
Location: Florida
Distribution: Many
Posts: 111

Original Poster
Rep: Reputation: Disabled
Thank you!
 
Old 02-19-2014, 02:02 AM   #21
udaya111
LQ Newbie
 
Registered: Feb 2014
Posts: 1

Rep: Reputation: Disabled
gzip a string

Brandon9000

Me too have to do a same thing in c/c++.Can u please guide me?

If you are done with that....Can u please send me the code to do that using C/C++?
 
  


Reply

Tags
compression, gzip, zip, zlib


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] copy string a to string b and change string b with toupper() and count the chars beep3r Programming 3 10-22-2010 07:22 PM
how to open gzip file? I have gzip installed mhg Linux - Newbie 3 10-24-2008 02:18 AM
[gzip] appears in process table after gzip command completes redmanDBA Linux - General 0 02-26-2008 06:12 AM
apt-get update error: "gzip: stdin: not in gzip format" haertig Debian 0 08-02-2006 05:21 PM
Solaris 8 gzip issues- cannot gzip -d lynx sixosix Solaris / OpenSolaris 4 03-13-2005 03:17 PM


All times are GMT -5. The time now is 02:06 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration