cap-std icon indicating copy to clipboard operation
cap-std copied to clipboard

Add support for files whose canonical paths use UNC prefixes.

Open sunfishcode opened this issue 4 years ago • 3 comments

On Windows, files on network shares have a canonical path which starts with the UNC "\?" prefix. With these prefixes, the OS no longer handles "." paths and trailing slashes, so handle them manually.

Fixes #2650.

sunfishcode avatar Feb 16 '21 21:02 sunfishcode

Looking at the test failures, this needs some more work before it's ready.

sunfishcode avatar Feb 17 '21 01:02 sunfishcode

Windows has some functions which perform canonicalization. I've now submitted https://github.com/retep998/winapi-rs/pull/992 to add bindings to these in winapi, so we can experiment with using those instead of trying to do the canonicalization manually.

sunfishcode avatar May 26 '21 22:05 sunfishcode

Another option is to use windows-rs. That seems like the next thing to try here.

sunfishcode avatar Jun 15 '21 21:06 sunfishcode

A better path forward for this issue is to change cap-std to use NtCreateFile, which is available as a windows-sys API, so it's stable to use. That way we won't have to do path concatenation and deal with all of these subtle canonicalization and UNC details.

sunfishcode avatar Dec 07 '22 19:12 sunfishcode