创建目录代码:(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>