-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Use FileManager API to get current working directory #5267
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
base: main
Are you sure you want to change the base?
Conversation
@swift-ci test |
Could we add tests for this? |
5ee648b
to
d4a2ea5
Compare
test added |
@swift-ci test |
82bf6bf
to
88dcf1b
Compare
@swift-ci test |
@swift-ci test windows |
@swift-ci test linux |
@swift-ci 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.
Let's identify the user level API this is supposed to change - this CF API should not be used directly, and in any case is all eventually being replaced by Swift code.
So the swift API that would be affected was going to have this as well (FileManager.currentDirectoryPath - see swiftlang/swift-foundation#1479) but that PR also cause the NSURL test to fail so it was reverted (swiftlang/swift-foundation#1512) until a fix could be put in place (this). |
@swift-ci test |
@parkera Is my last comment clear on where this prefix is originating from? I would like to resurrect this (swiftlang/swift-foundation#1479) foundation change that was reverted once this goes in. |
88dcf1b
to
4272bf9
Compare
- FileManager handles long file name prefixes on Windows correctly. This keeps any UNC long file prefix (\\?\) out of URL that were relative and then resolved to absolute urls.
@swift-ci test |
4272bf9
to
830ce1e
Compare
@swift-ci test |
@swift-ci test windows |
@swift-ci test windows |
@parkera @jmschonfeld are we good with the latest changes? |
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 LGTM (since as you mentioned there's an existing test that validates the behavior here). Have you been able to test this with your original swift-foundation change to confirm that if we reintroduce the swift-foundation change that the tests here still succeed?
Just tried it, so far so good 👍 |
This keeps any UNC long file prefix (
\\?\
) out ofURL that were relative and then resolved to absolute urls.