c++14判断文件夹是否存在已经是否是空文件夹

代码

#include
#include

int main()
{
	std::string dicom_dir = "D\\hablee";
	if (std::experimental::filesystem::exists(dicom_dir) == false)
    {
        std::cout << dicom_dir << " is not exists." << std::endl;
        return;
    }
    else
    {
        if (std::experimental::filesystem::is_empty(dicom_dir))
        {
            std::cout << dicom_dir << " is empty." << std::endl;
            return;
        }       
    }
    // 
    std::cout<<dicom_dir<<" exists and is not empty."<<std::endl;

	return 0;
}

你可能感兴趣的:(c++学习,c++,算法,开发语言)