这个是AssetsManagerEx的问题,在解压文件的时候没有创建目录,导致创建不了文件进行写入
AssetsManagerEx.cpp 337行
// Check if this entry is a directory or a file.
const size_t filenameLength = strlen(fileName);
if (fileName[filenameLength-1] == '/')
{
//There are not directory entry in some case.
//So we need to create directory when decompressing file entry
if ( !_fileUtils->createDirectory(basename(fullPath)) )
{
// Failed to create directory
CCLOG("AssetsManagerEx : can not create directory %s\n", fullPath.c_str());
unzClose(zipfile);
return false;
}
}
else
{
//新加的代码
std::string dir = basename(fullPath);
if(!_fileUtils->isDirectoryExist(dir)) {
if(!_fileUtils->createDirectory(dir)) {
// Failed to create directory
CCLOG("AssetsManagerEx : can not create directory %s\n", fullPath.c_str());
unzClose(zipfile);
return false;
}
}