www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22059] New: std.file: Long paths support on Windows requires

https://issues.dlang.org/show_bug.cgi?id=22059

          Issue ID: 22059
           Summary: std.file: Long paths support on Windows requires
                    explicit \\?\ prefix
           Product: D
           Version: D2
          Hardware: All
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: kinke gmx.net

```
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

--
Jun 21