High level ones:
let s = try String(contentsOfFile: filename, encoding: .utf8)
try s.write(toFile: filename, atomically: true, encoding: .utf8)
Low level ones:
import Foundation
let fileManager = FileManager.default()
guard let enumerator = fileManager.enumerator(atPath: path) else { fatalErro
If I've surmised correctly from other messages on this thread, you should
be able to `import Glibc` and then you can use most of what's in the C
standard library (since Swift interoperates directly with C). The module
map which enables you to import Glibc is:
https://github.com/apple/swift/blob/mas
I'm a new swift person, /long/ time unix/linux developer, mac user but
only mac developer inasmuch as mac is unix. I've installed swift on my
ubuntu box, written hello world, etc.
Now... to write much of anything else, I need a way to
open/read/write/close a file. I don't see anything like that