創建目錄代碼:(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>