swift, file handling, renaming files
let fileManager = FileManager.default let currentPath = "/path/to/current/file.txt" let newPath = "/path/to/new/file.txt"
do { try fileManager.moveItem(atPath: currentPath, toPath: newPath) } catch { print("Error while renaming file: (error)") }
main.swift364 chars5 lines
gistlibby LogSnag