[RESOLVED] Reading/Writing data from/to ZIP
I have a game that have many data (textures, sound, etc.). I want to pack them in ZIP like textures.zip, sound.zip, etc, then read/write files from my code. I didn't found any examples for reading files from ZIP without unzipping. Please help me! :(
P.S: Maybe it's better to use Resource file?
P.P.S: Sorry for my English.
Re: Reading/Writing data from/to ZIP
Unfortunately, all the zip implementations I know of need to write an output file. Let me explore a little for you to see if I can find any "unzip-to-memory" compression libraries.
Do you care that it's "ZIP"? I think there are some out there that are specifically made for gaming but they don't use the PKZIP compression scheme and file structure.
Re: Reading/Writing data from/to ZIP
Quote:
Originally Posted by
Jenner
Do you care that it's "ZIP"? I think there are some out there that are specifically made for gaming but they don't use the PKZIP compression scheme and file structure.
Thanks for reply :)
I don't care about ZIP format. Maybe it is better to use packages such as .pak and .pk. Where i can find free libraries for packaging/unpackaging/reading/etc. paks?
Re: Reading/Writing data from/to ZIP
Ok, I did some checking and found the SharpZip library can do what you want.
It's free (GPL license) and it works via Streams. Thus, all you do is specify the target ZIP archive, the file you want from it, and it makes a stream. What you do from that point is up to you. You could then direct it to a streamwriter pointing to a file if you wanted to write the extracted file to disc, or you could just keep it in memory and use it, etc...
Check it out.
Re: Reading/Writing data from/to ZIP
Quote:
Originally Posted by
Jenner
Check it out.
Thanks you! I'm also found a free PAK lib, in my game i will use PAK, ZIP i will use in other things. Thanks! :)
*adding rep*
Re: [RESOLVED] Reading/Writing data from/to ZIP
PAK was designed for games I think so it's probably a better choice anyways! Where did you find it? Can you post a link?
Re: [RESOLVED] Reading/Writing data from/to ZIP
Quote:
Originally Posted by
Jenner
PAK was designed for games I think so it's probably a better choice anyways! Where did you find it? Can you post a link?
I found it on freevbcode.com, here is a link. ;)
Re: [RESOLVED] Reading/Writing data from/to ZIP
Nice find! *adding rep as well*