c++14
路径是否存在
bool filePathExists(std::experimental::filesystem::path& file_path)
{
if (std::experimental::filesystem::exists(file_path) && !std::experimental::filesystem::is_directory(file_path))
{
return true;
}
else return false;
}
文件夹是否存在
bool folderPathExists(std::experimental::filesystem::path& folder)
{
if (std::experimental::filesystem::exists(folder) && std::experimental::filesystem::is_directory(folder))
{
return true;
}
else return false;
}
bool folderPathExists(const std::string& folder)
{
std::experimental::filesystem::path inputFolder(folder);
return folderPathExists(inputFolder);
}