string path = "./";
for (auto it : directory_iterator(path))
{
cout << it.path() << endl;
}
if (exists(path))
{
cout << "path exist" << endl;
}
directory_entry entry(path);
if (entry.status().type() == file_type::directory)
{
cout << "path directory" << endl;
}
//void copy(const path & from, const path & to) :目录复制
//path absolute(const path & pval, const path & base = current_path()) :获取相对于base的绝对路径
//bool create_directory(const path & pval) :当目录不存在时创建目录
//bool create_directories(const path & pval) :形如 / a / b / c这样的,如果都不存在,创建目录结构
//bool exists(const path & pval) :用于判断path是否存在
//uintmax_t file_size(const path & pval) :返回目录的大小
//file_time_type last_write_time(const path & pval) :返回目录最后修改日期的file_time_type对象
//bool remove(const path & pval) :删除目录
//uint
c++ filesystem 使用
最新推荐文章于 2024-06-19 10:12:40 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)