Last active
October 16, 2019 16:39
-
-
Save andrewwoz/1c3b69b1abc5ed8e686370f05992cfe2 to your computer and use it in GitHub Desktop.
[Creating symbolik links on files using swift] #fs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let fs = FileManager.default | |
| let docs = ... | |
| let articleURL = docs.appendingPathComponent("article.txt") | |
| let linkURL = docs.appendingPathComponent("article.link.txt") | |
| do { | |
| try fs.createSymbolicLink(at: linkURL, withDestinationURL: articleURL) | |
| } catch let error { | |
| print(error) | |
| } | |
| let destinationPath = try? fs.destinationOfSymbolicLink(atPath: linkURL.path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment