Bug 22059 – std.file: Long paths support on Windows requires explicit \\?\ prefix

Status
NEW
Severity
normal
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2021-06-21T15:28:51Z
Last change time
2024-12-01T16:39:00Z
Assigned to
No Owner
Creator
kinke
Moved to GitHub: phobos#9825 →

Comments

Comment #0 by kinke — 2021-06-21T15:28:51Z
``` void main() { import std.file; // works assert(exists(`\\?\C:\Users\Martin\AppData\Local\dub\packages\mir-algorithm-1.0.1\mir-algorithm\.dub\build\library-unittest-windows-x86_64-ldc_2079-0C3BC09825103C01E6AE45507110137D\library-unittest-windows-x86_64-ldc_2079-0C3BC09825103C01E6AE45507110137D\library-unittest-windows-x86_64-ldc_2079-0C3BC09825103C01E6AE45507110137D.obj`)); // fails assert(exists(`C:\Users\Martin\AppData\Local\dub\packages\mir-algorithm-1.0.1\mir-algorithm\.dub\build\library-unittest-windows-x86_64-ldc_2079-0C3BC09825103C01E6AE45507110137D\library-unittest-windows-x86_64-ldc_2079-0C3BC09825103C01E6AE45507110137D\library-unittest-windows-x86_64-ldc_2079-0C3BC09825103C01E6AE45507110137D.obj`)); } ``` The prefix shouldn't be required and added automatically, as the Visual Studio 2019 linker doesn't require that prefix, nor does the LLD linker, nor does DMD, ... Phobos should essentially use something very similar to DMD's extendedPathThen() helper: https://github.com/dlang/dmd/blob/ef39b070819216a8d9835e2a66d3e365420763ec/src/dmd/root/filename.d#L1146
Comment #1 by robert.schadek — 2024-12-01T16:39:00Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9825 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB