Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: implement conversion to/from UNC paths #284

Closed
wants to merge 3 commits into from

Conversation

wfraser
Copy link
Contributor

@wfraser wfraser commented Feb 28, 2017

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 Reviewable

@bors-servo
Copy link
Contributor

☔ The latest upstream changes (presumably #331) made this pull request unmergeable. Please resolve the merge conflicts.

@bors-servo
Copy link
Contributor

☔ The latest upstream changes (presumably #321) made this pull request unmergeable. Please resolve the merge conflicts.

bors-servo pushed a commit that referenced this pull request Jun 13, 2017
Windows: implement conversion to/from UNC paths

This is a rebase of #284 with some additional fixes. Original work by @wfraser, sorry I took so long to get to this!

Fixes #284.

r? @nox for the last two commits.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-url/360)
<!-- Reviewable:end -->
@SimonSapin
Copy link
Member

Landed with a rebase and some fixes in #360. Sorry this took so long!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants