Windows: implement conversion to/from UNC paths #284
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, taking a path like
\\fileserver\share\foo\bar.txt
and trying to make a URL out of it results in an error. However, this can be turned into a file URL:file://fileserver/share/foo/bar.txt
. Note the lack of the usual triple-slash.The reverse is also implemented: a
file:
URL with a non-empty host is taken to be a UNC path.This conversion is only enabled on Windows.
I was motivated to do this after trying to run Cargo in a remote directory. Currently it errors out because it uses
rust-url
to convert all its paths to URLs, and fails to convert its working directory to one. I made a build of Cargo using these changes, and it was then able to build in a directory on a remote machine!This change is