lua有个函数叫os.execute("md 123")
就相当于在cmd里执行了md 123
所以删除文件夹就是rd 改名就是rn
在 cocos2d-x 2.x 的 AssetsManager sample 范肢慎例中提供了一个 reset 方法,这个方法使用系统命令递归删除文件夹。void UpdateLayer::reset(cocos2d::CCObject *pSender)
{
pProgressLabel->setString(" ")
// Remove downloaded files
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32)
string command = "rm -r "
// Path may include space.
command += "\"" + pathToSave + "\""
system(command.c_str())
#else
string command = "rd /s /q "
// Path may include space.
command += "\雀敏"" + pathToSave + "顷饥枝\""
system(command.c_str())
#endif
// Delete recorded version codes.
getAssetsManager()->deleteVersion()
createDownloadedDir()
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)