Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

New Member
Posts: 1
Registered: ‎09-25-2013
My Device: Z10
My Carrier: Three

Cocos2d-x CCFileUtils::getFileDataFromZip

[ Edited ]

I am unable to read the contents of zip files on BlackBerry 10.2 using getFileDataFromZip


It gets as far as support\zip_support\unzip.cpp Line 617


The call to the macro ZOPEN64 always returns NULL


I have checked the path to the file and checked I can open the file using fopen


This is the same if it is a bundled resource or downloaded to getWriteablePath


Has anyone managed to read the contents of a zip file on BlackBerry?

Posts: 170
Registered: ‎09-06-2010
My Device: None
My Carrier: None

Re: Cocos2d-x CCFileUtils::getFileDataFromZip

I get the same behaviour that you see when doing this with a ZIP "foobar.zip" containiing a file "me.png" in the path "Resources/foobar.zip" in the project.


    CCLog("XXXX Starting file test");

    unsigned long filesize = 0;
    const char *myFile = "foobar.zip";

    const char *path = CCFileUtils::sharedFileUtils()->fullPathForFilename(myFile).c_str();

    CCLog("XXXX path=%s", path);

    const char *buffer = (const char *)CCFileUtils::sharedFileUtils()->getFileDataFromZip(myFile, "me.png", &filesize);

    CCLog("XXXX filesize=%d", (int)filesize);
    CCLog("XXXX Ending file test");

I see:


cocos2d-x debug info XXXX Starting file test
cocos2d-x debug info XXXX path=app/native/Resources/foobar.zip
cocos2d-x debug info XXXX filesize=0
cocos2d-x debug info XXXX Ending file test

 The full path is reported as "app/native/Resources/foobar.zip" which is correct.


Could you please log a bug: DIT ?