在 Windows 上的 C 控制臺應用程式中,我試圖打破
The source code is very simple; it's also on 
To finish
i can only say that i don't know what else to test or if adding longPathAware element to the manifest is even possible with the type of application i'm trying to achieve that.
Maybe there's another api to change the current working folder of my application to a long path, and i would be fine with it, but at least _chdir and std::filesystem::current_path have the same limitations.
Workarounds
Using short names aka. 8.3 aliases might provide a limited work around.
For my cases this is often not feasible because short paths don't need to exists; they can be controlled system wide or per volume:
- The general state can be queried with
fsutil 8dot3name query - The per volume setting can be queried with
fsutil behavior query disable8dot3 c:
Sidenotes
- The manifest can be embedded in the executable or a dll.
- It will be ignored when the dll containing it is delay loaded.
- It will not be ignored by the delay loaded dll when the executable is containing it.
- Because the Manifest is "additional" in the project settings, it doesn't need the assemblyIdentity element.
uj5u.com熱心網友回復:
清單適用于您的應用程式,它允許您選擇加入長路徑支持。
但是,還必須在系統范圍內啟用長路徑支持。這是組策略“計算機配置 > 管理模板 > 系統 > 檔案系統 > 啟用 Win32 長路徑”。
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
"LongPathsEnabled"=dword:00000001
這種設計毫無意義,但它就是這樣。您不能爭辯說它是以兼容性的名義,因為\\?\至少從 Windows 2000 開始就可以創建長路徑。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/448921.html
標籤:c windows filesystems c 17 long-path
