Skip to content

FileManager.fileExists(atPath:) should follow symlinks on Windows #859

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

Merged

Conversation

jmschonfeld
Copy link
Contributor

As a followup to #858, I've also noticed that FileManager.fileExists(atPath:) does not correctly handle symlinks on Windows. On Darwin/Linux this function determines if the destination of the symlink exists, but on Windows it currently checks whether the symlink itself exists. This updates the logic to follow the symlink and check the destination instead to match previous (swift 5.10) Windows behavior (and behavior on Darwin/Linux)

@jmschonfeld
Copy link
Contributor Author

@swift-ci please test

@jmschonfeld
Copy link
Contributor Author

This PR depends on changes from #858, I'll wait until that is merged and then rebase and re-run tests

@jmschonfeld jmschonfeld force-pushed the windows/file-exists-follow-symlinks branch from 0302cd5 to 699469b Compare August 16, 2024 17:48
@jmschonfeld
Copy link
Contributor Author

@swift-ci please test

@jmschonfeld jmschonfeld merged commit 7242610 into swiftlang:main Aug 16, 2024
3 checks passed
@jmschonfeld jmschonfeld deleted the windows/file-exists-follow-symlinks branch August 16, 2024 18:19
jmschonfeld added a commit to jmschonfeld/swift-foundation that referenced this pull request Aug 16, 2024
cthielen pushed a commit to cthielen/swift-foundation that referenced this pull request Nov 8, 2024
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