#include <iostream> #include <fstream> #include <cstdint> #include <experimental/filesystem> namespace fs = std::experimental::filesystem; void demo_exists(const fs::path& p, fs::file_status s = fs::file_status{}) { std::cout << p; if(fs::status_known(s) ? fs::exists(s) :...
由此函数提供的信息通常也作为目录遍历的副产物提供。在遍历目录时,调用exists(*iterator)不如exists(iterator->status())高效。 示例 运行此代码 #include <cstdint>#include <experimental/filesystem>#include <fstream>#include <iostream>namespacefs=std::experimental::filesystem;voiddemo_exists(constfs::path&...
represents file type and permissions (class) statussymlink_status cached status of the file designated by this directory entry cached symlink_status of the file designated by this directory entry (public member function ofstd::experimental::filesystem::directory_entry)...