Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: Matreju on July 09, 2006, 04:20:37 pm

Title: unzipping files
Post by: Matreju on July 09, 2006, 04:20:37 pm
Which libraries are needed for unzipping files on windows with mingw ? I have found zlib and compiled. But it seems to be for gzip files. Not for zip. Or do i make mistakes ?
Title: Re: unzipping files
Post by: ironhead on July 09, 2006, 05:06:30 pm
There are many programs that will extract gzipped files, including winzip, 7-zip and many others.  If you are looking for a command line utility you could try gunzip.
Title: Re: unzipping files
Post by: Matreju on July 09, 2006, 05:11:45 pm
No..I dont search a command line utility. I need it for developing in C/C++. A library or something.

Automatic opening and searching zipped datafiles. Extracting the files if data in file hits. A kind of fast precollecor in a processchain.
Title: Re: unzipping files
Post by: killerbot on July 09, 2006, 05:18:57 pm
maybe wxWidgets has api functions for this :
wxZipInputStream/wxZipOutputStream (check out the docs at www.wxwidgets.org)
Title: Re: unzipping files
Post by: Matreju on July 09, 2006, 05:21:41 pm
I see . My question seemed no to be stupid. Its an server application. Didnt i have an big overhead wenn i link against wxwidget ? But i will try this way.
Title: Re: unzipping files
Post by: Game_Ender on July 09, 2006, 05:27:25 pm
Zlib can handle both zip and gzip files, but the library only handles files, not archives.  If you want to be able to use zlib to handle archives you need to use minizip in the contrib/minizip folder in the zlib distribution.  It comes with 2 example programs minizip, and miniunz.

Don't use wxWidgets here if you have to, it would be way to big for a server.
Title: Re: unzipping files
Post by: Matreju on July 09, 2006, 05:36:27 pm
*grmpf* There is no distri and no mini in my zlib 1.2.3 archive. But i have downloaded it from the zlib website and compiled.
Title: Re: unzipping files
Post by: Charon on July 09, 2006, 07:39:42 pm
you could give physfs a chance too.

its pretty easy to open zip-files with it, although this is not its only purpose to exist.
(actually it implements a virtual filesystem, but this way it gives you the added bonus to enumerate files in a subfolder inside a zip-file and so on)

http://icculus.org/physfs/ (http://icculus.org/physfs/)
Title: Re: unzipping files
Post by: Michael on July 11, 2006, 08:26:28 pm
No..I dont search a command line utility. I need it for developing in C/C++. A library or something.

Automatic opening and searching zipped datafiles. Extracting the files if data in file hits. A kind of fast precollecor in a processchain.

Hello,

May be this could be of some interest:

http://www.7-zip.org/sdk.html

Best wishes,
Michael
Title: Re: unzipping files
Post by: Game_Ender on July 11, 2006, 09:44:27 pm
*grmpf* There is no distri and no mini in my zlib 1.2.3 archive. But i have downloaded it from the zlib website and compiled.

I just downloaded the one from the site and it is there.  Use this (http://www.zlib.net/zlib-1.2.3.tar.gz) link.  Unpack it and you go into the the zlib-1.2.3/contrib/minizip folder.  Have a look at the minizip.c/.h and miniunz.c/.h.