COCOS2DX 创建目录

创建目录代码:(C++)

DIR *pDir=opendir(FileUtils::getInstance()->getWritablePath().c_str());
if (!pDir){
	//创建该路径
	mkdir(FileUtils::getInstance()->getWritablePath().c_str(), S_IRWXU | S_IRWXG | S_IRWXO);
}

PS:

在调用前应引用头文件

		#include <dirent.h>
		#include <sys/stat.h>


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章