//判断目录文件是否存在
#include <iostream>
#include <dirent.h>
#include <string>
using namespace std;
int main()
{
std::string name;
std::string path = "./" + name;
auto dir = opendir(path.data());
if(dir == NULL)
std::cout << "目录不存在" << std::endl;
else {
std::cout << "目录存在" << std::endl;
}
closedir(dir);
return 0;
}