Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Mar 19, 2008, 09:08 AM   #1
nunyabeezwax
macrumors newbie
 
Join Date: Jul 2007
unzip via C++

I have an application that downloads updates to support files and the application itself from a web server. I want to be able to unzip the file while it is still in memory and then save it uncompressed. Right now I am just saving the zip file and decompressing it manually. I am looking for a code sample or a hint to a function or even a way to do this with BOMArchiveHelper.

Thanks,

John.
nunyabeezwax is offline   0 Reply With Quote
Old Mar 19, 2008, 10:33 AM   #2
ScoobyMcDoo
macrumors 65816
 
Join Date: Nov 2007
Location: Austin, TX
You can probably find what you need here.
ScoobyMcDoo is offline   0 Reply With Quote
Old Mar 19, 2008, 11:10 AM   #3
nunyabeezwax
Thread Starter
macrumors newbie
 
Join Date: Jul 2007
Thanks for the quick reply, but I was looking for an intrinsic solution either via a function or a call to an external program like BOMArchiverHelper.

Thanks,
John
nunyabeezwax is offline   0 Reply With Quote
Old Mar 19, 2008, 01:59 PM   #4
MacsAttack
macrumors 6502a
 
Join Date: Jul 2006
Location: Scotland
Why not use the unzip command - should be possible to issue command line calls from within a program...

like this... http://maccoder.blogspot.com/2007/04...d-line-in.html

Guess you could make the call to execute BOMArchiveHelper, but I've found on several occasions that it will not always work with files from Windows systems. The unzip command line utility (included with OS X) is more reliable.

Just fire up the terminal and type "man unzip" to see more
__________________
Security: “You are coming to a sad realization. Cancel or Allow?”
PC: “…… Allow.”
MacsAttack is offline   0 Reply With Quote
Old Mar 19, 2008, 03:45 PM   #5
nunyabeezwax
Thread Starter
macrumors newbie
 
Join Date: Jul 2007
Thanks, that is a great help and I will give it a go but my goal is still to call a function and not a outside program. So if anyone else has a suggestion it would be appreciated.

Thanks again,

John
nunyabeezwax is offline   0 Reply With Quote
Old Mar 19, 2008, 04:38 PM   #6
Cromulent
macrumors 603
 
Cromulent's Avatar
 
Join Date: Oct 2006
Location: The Land of Hope and Glory
Quote:
Originally Posted by nunyabeezwax View Post
Thanks, that is a great help and I will give it a go but my goal is still to call a function and not a outside program. So if anyone else has a suggestion it would be appreciated.

Thanks again,

John
Look around for a zip library. It would be much easier though just to use a system() call.

You won't just find a single function solution with a zip file I'm afraid if you go the library route. You'll still need to read the file, process it and write the data back to another file.

Edit : Here you go : http://www.zlib.net/
__________________
Neural Advance - Mac OS X, UNIX and Windows Development
Last.fm Profile | Extreme Metal Reviews
MP 4x 2.66Ghz Xeons / 6GB RAM / 640GB + 500GB + 750GB + 1TB HDDs / ATI Radeon 4870 / iPad 3
Cromulent is offline   0 Reply With Quote
Old Mar 19, 2008, 05:48 PM   #7
nunyabeezwax
Thread Starter
macrumors newbie
 
Join Date: Jul 2007
I have already completed this code for win but when I attempted to compile the zip code for Mac there were plenty of errors. So, I was just thinking that there would be a Mac function(and yes I realized it could be several functions) but I could not find it via my searching so I was relying on help here. The boss isn't real happy about the system call(neither of us has any experience with them) and I didn't want to fix all the errors but I guess I will have to!

Thanks to everyone who helped or anyone else that may have an alternate solution,

John
nunyabeezwax is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
unzipping ACE files? flat6 Mac Applications and Mac App Store 1 Jan 24, 2006 05:31 PM
what do I unzip .1, .2, .3, ... files with? flat6 Mac Applications and Mac App Store 5 Jan 11, 2006 06:12 AM
WoW Beta client of FilePlanet won't unzip Hackett Games 5 Nov 4, 2004 09:59 PM
unzipping files j_maddison Mac Applications and Mac App Store 7 Jun 1, 2004 09:07 AM
Unzipping .zips with passwords applemacdude General Mac Discussion 7 Sep 5, 2003 05:48 PM


All times are GMT -5. The time now is 03:57 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC