Zip File reading

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
[dx/x]=HUNT3R
Posts: 271
Joined: Sat Aug 23, 2003 5:52 pm
Location: Hurricane Central, Florida

Zip File reading

Post by [dx/x]=HUNT3R »

This is for Niko or anyone else who has an idea...

I'm working on a small project to read files stored (uncompressed) in a .zip file and I need to rewrite all of the stdio functions to work on the files in the .zip file. I've been studying zlib but it's not working out. I can easily open the zip file and locate any file I need to by name and then read that file into memory (a void*), but I cannot figure out how to make my functions (fread, ftell, fseek, ...) operate on the memory. I have tried looking at how Niko does it in Irrlicht but I'm just not seeing it. I cannot just use the stdio functions b/c they require the file to be opened by filename (FILE* fp = fopen(const char* filename, const char* mode)) and I cannot "see" the filenames inside the zipfile.

Does anyone have any experience with this or have any ideas :?:
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

That'S why I wrote a wrapper, you don't use fread to read data, but IReadFile::read. And there are several implementations of IReadFile: one that can read ordinary data, and one that can read .zip files.
[dx/x]=HUNT3R
Posts: 271
Joined: Sat Aug 23, 2003 5:52 pm
Location: Hurricane Central, Florida

Post by [dx/x]=HUNT3R »

thx 4 the reply Niko, I got the .zip file specifications from http://www.pkware.com/products/enterpri ... ote.html#2 and I'm just writing my own zip file reader now. It's working out good so I'm not even gonna bother with zlib anymore (I don't need compression anyway).
Post Reply