c++ filesystem 使用

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::direc..
摘要由CSDN通过智能技术生成
	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
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值