Last active
October 16, 2019 15:16
-
-
Save andrewwoz/57d03b1b18f51a69578f700107814c61 to your computer and use it in GitHub Desktop.
[Copying files] #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 fileURL = docsURL.appendingPathComponent("file.txt") | |
| fs.createFile( | |
| atPath: fileURL.path, | |
| contents: ..., | |
| attributes: nil) | |
| let copyURL = docsURL.appendingPathComponent("file-copy.txt") | |
| try? fs.copyItem(at: fileURL, to: copyURL) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment