【发布时间】:2020-07-04 11:42:12
【问题描述】:
我有这段代码
auto path = std::filesystem::path("/root/home/../opt/.");
我曾尝试过 std::filesystem::absolute(),但后来意识到这不是我想要的结果
我的问题是如何将该相对路径转换为绝对路径,以便结果为"/root/opt/"。
我在 Debian g++-9 上使用 c++17
【问题讨论】:
-
您想要规范路径 (link)。
标签: c++ c++17 filepath c++-standard-library std-filesystem