0
我已經構建了一個自定義框架和隨附的資源包,用於其他項目。資源束包含各種.sqlite和.bin文件。我試圖用我的框架在另一個項目中打開一個.bin文件,但沒有成功。使用fopen打開.bundle中的文件()
假設我的軟件包名爲CustomFramework.bundle。我有一個類ResourceHelper.cpp在我的框架內試圖打開mybin.bin位於CustomFramework.bundle。
這裏是我目前如何嘗試打開它:
void ResourceHelper::openBinFromResourceFolder(FILE **file) {
std::string path;
path = "CustomFramework.bundle/";
path.append("mybin.bin");
*file = fopen(path.c_str(), "rb");
}
file
這是fopen()調用後NULL。
我想如何在我的.bundle中打開.bin文件?
感謝