标签: long-path

如何使用 std::filesystem::path 正确处理带有长路径前缀的 Windows 路径

std::filesystem::path似乎不知道Windows 长路径 magic prefix。这是每个设计还是有可以使用的模式/标志/编译器开关/第三方库?

  • 对于像 之类的路径C:\temp\test.txtroot_nameisC:root_pathisC:\都是有效路径,但是
  • 因为\\?\C:\tmp\test.txt他们是\\?并且\\?\

我希望它们是C:C:\因为\\?\它不是路径,而只是一个用于解决旧版 Windows 260 字符路径限制的标签。

请参阅compilerexplorer 上的完整示例

c++ windows c++17 std-filesystem long-path

8
推荐指数
1
解决办法
4478
查看次数

标签 统计

c++ ×1

c++17 ×1

long-path ×1

std-filesystem ×1

windows ×1