判断文件夹是否存在

include

include

include

include <Windows.h>

include <stdio.h>

include <direct.h>

include <io.h>

using namespace std;

int main(){
std::string prefix = "./Log/";
if (_access(prefix.c_str(), 0) == -1) //如果文件夹不存在
_mkdir(prefix.c_str()); //则创建
//system("mkdir .\Log");

return 0;
}

posted @ 2021-06-24 09:31  江南王小帅  阅读(118)  评论(0)    收藏  举报