Re: [swift-users] simple i/o on linux with open source swift

2016-07-17 Thread Andrey Fidrya via swift-users
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

Re: [swift-users] simple i/o on linux with open source swift

2016-07-16 Thread Jacob Bandes-Storch via swift-users
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

[swift-users] simple i/o on linux with open source swift

2016-07-16 Thread K Richard Pixley via swift-users
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