Zip Extraction
Zip Extraction
Anybody have a source code example on extracting zip files?
-
- Posts: 107
- Joined: Sat Jan 13, 2007 11:50 am
A working implementation exists in JGE++'s source code:
http://code.google.com/p/wagic/source/b ... /src/unzip
http://code.google.com/p/wagic/source/b ... System.cpp
But as it's been said, there's nothing PSPecific about this
http://code.google.com/p/wagic/source/b ... /src/unzip
http://code.google.com/p/wagic/source/b ... System.cpp
But as it's been said, there's nothing PSPecific about this
THANKS coolkehon your library still works perfectly!
Now I have a new problem:
This only allocates 4 bytes (int ?). How can I fix it? Sorry I'm new to dynamic memory allocation XD
I know this is probably some stupid little thing I'm just not thinking of...
Now I have a new problem:
Code: Select all
... if(unzGetCurrentFileInfo(zipFd, &curZipFileInfo, fNameBuf, sizeof(fNameBuf), NULL, 0, NULL, 0) == UNZ_OK) {
if(curZipFileInfo.uncompressed_size > 0) {
printf("Allocate %d Bytes for %s\n", (int)(curZipFileInfo.uncompressed_size)+1, fNameBuf);
fileBuff = (char *)realloc(fileBuff, curZipFileInfo.uncompressed_size+1);...
I know this is probably some stupid little thing I'm just not thinking of...
Yeah its allocating the size of the pointer int (4 bytes) not the value of the pointer represented as an integer... if that makes sense...coolkehon wrote:i did this once by accident it was a pointer problem dont rember if it was like this or what but i was writting a pointer instead of the data to the pointer or vice versa make sure you have all the info correct with pointers because the size of a pointer i believe is 4 bytes