Skip to content

Instantly share code, notes, and snippets.

@andrewwoz
Last active October 16, 2019 15:16
Show Gist options
  • Select an option

  • Save andrewwoz/57d03b1b18f51a69578f700107814c61 to your computer and use it in GitHub Desktop.

Select an option

Save andrewwoz/57d03b1b18f51a69578f700107814c61 to your computer and use it in GitHub Desktop.
[Copying files] #fs
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