-
Notifications
You must be signed in to change notification settings - Fork 194
Support Windows URL paths in FoundationEssentials #602
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
Conversation
@swift-ci please test |
@swift-ci please test Windows platform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks fine overall to me, but I'll let @compnerd validate the Windows behavior 🙂
Oops, fixing the Windows build failures now. |
@swift-ci please test Windows platform |
@swift-ci please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This definitely seems to help! Thank you for doing this.
One thing that shows up with this:
|
I think that this is due to the path containing |
Thanks for pointing this out! I think the last two commits might help address this. I also opted to keep server/share as part of the path to let the Windows APIs handle it, since I think setting |
@swift-ci please test |
@swift-ci please test Windows platform |
@swift-ci please test Windows platform |
@swift-ci please test |
This is definitely doing way better! There are a few hangs that need to be diagnosed still, but this is the state after this change:
|
Ah, looks like the |
I'm going to merge this to unblock other work, but I will open up a new PR to fix the |
Supports initializing file URLs with Windows paths. Allow
"\"
as the path separator, allow UNC paths ("\\"
) with host, and allow/standardize drive letter paths ("C:"
). However, we always store the URL with forward slashes to stay consistent for path parsing operations. I thinkString.withNTPathRepresentation(_:)
should then be used to convert any"/"
back to"\"
before consulting the file system on Windows. @compnerd thoughts on this approach?The file URL initializers also now resolve against the base URL (or current directory) for checking if the file is a directory.