dart-lang/path

Support \\?\ prefix in UNC Windows paths

Opened this issue · 2 comments

Awjin commented

See https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN#win32-file-namespaces:

For file I/O, the "\\?\" prefix to a path string tells the Windows APIs to disable all string parsing and to send the string that follows it straight to the file system.

Currently, path supports UNC paths, but does not support this prefix.

This prohibits Dart Sass from properly parsing such paths with toUri: sass/dart-sass#1258

Can you give an example call and what you'd like to see the path package do differently with it?

nex3 commented

Generally, the \\?\ prefix should be stripped and the remainder of the path should be parsed as a standard Windows path. For example, \\?\C:\foo\bar should be treated as equivalent to C:\foo\bar. The main difference is that if the path contains a . or .. component, that should not be resolved as a traversal reference.