Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nunyabeezwax

macrumors newbie
Original poster
Jul 19, 2007
6
0
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

macrumors newbie
Original poster
Jul 19, 2007
6
0
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
 

MacsAttack

macrumors 6502a
Jul 2, 2006
825
0
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/interacting-with-command-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
 

nunyabeezwax

macrumors newbie
Original poster
Jul 19, 2007
6
0
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
 

Cromulent

macrumors 604
Oct 2, 2006
6,812
1,100
The Land of Hope and Glory
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/
 

nunyabeezwax

macrumors newbie
Original poster
Jul 19, 2007
6
0
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.