c/c++ 判断目录不存在时自动创建(win32)
版权声明:
本文为博主原创文章,转载请声明原文链接...谢谢。o_0。
更新时间:
2018-03-18 20:35:37
温馨提示:
学无止境,技术类文章有它的时效性,请留意文章更新时间,如发现内容有误请留言指出,防止别人"踩坑",我会及时更新文章
#include "shlwapi.h" #pragma comment(lib,"shlwapi.lib") if (!PathIsDirectory(cache_path.ToWString().c_str())) { SHCreateDirectory(NULL, cache_path.ToWString().c_str()); } if (!PathIsDirectory(log_file.ToWString().c_str())) { SHCreateDirectory(NULL, log_file.ToWString().c_str()); }