#include <string>
#include <iostream>
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
int main()
{
fs::path p("/usr/include/c++/../sys/*");
p = fs::canonical(p);
}
GCC 6.2.0編譯好了,但運行時錯誤說:爲什麼std :: experimental :: filesystem :: path不接受像「*」這樣的通配符?
terminate called after throwing an instance of 'std::experimental::filesystem::v1::__cxx11::filesystem_error'
what(): filesystem error: cannot canonicalize: No such file or directory [/usr/include/c++/../sys/*] [/data/svn/yaoxinliu] Aborted
爲什麼std::experimental::filesystem::path
不能接受像*
通配符?
設計的基礎是一個路徑對應於單個文件,而不是任意的一組文件。 –