swiftlang / swift-foundation

The Foundation project
Apache License 2.0
2.4k stars 160 forks source link

Fix windows creation of relative symlinks to directories #931

Closed jmschonfeld closed 1 month ago

jmschonfeld commented 1 month 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 month ago

@swift-ci please test

jmschonfeld commented 1 month ago

@swift-ci please test

jmschonfeld commented 1 month ago

@swift-ci please test Linux platform

jmschonfeld commented 1 month ago

@swift-ci please test

jmschonfeld commented 1 month ago

@swift-ci please test Windows platform

jmschonfeld commented 1 month ago

@swift-ci please test macOS platform