swiftlang / swift-foundation

The Foundation project
Apache License 2.0
2.36k stars 150 forks source link

Fix windows creation of relative symlinks to directories #931

Open jmschonfeld opened 1 day ago

jmschonfeld commented 1 day ago

On windows, we need to specify an extra flag if we are creating a symlink to a directory. To do this, we check if the provided destination is a directory using FileManager.fileExists(atPath:isDirectory:). However, the destination path is relative to the symlink and not relative to the current working directory like fileExists(atPath:) expects so we must first convert the relative path into an absolute path using the symlink path as a base.

Resolves https://github.com/apple/swift-foundation/issues/928

jmschonfeld commented 1 day ago

@swift-ci please test

jmschonfeld commented 11 hours ago

@swift-ci please test

jmschonfeld commented 11 hours ago

@swift-ci please test Linux platform

jmschonfeld commented 10 hours ago

@swift-ci please test

jmschonfeld commented 10 hours ago

@swift-ci please test Windows platform

jmschonfeld commented 10 hours ago

@swift-ci please test macOS platform