Re: [swift-users] Simple text file I/O with Swift 3 (Quinn "The Eskimo!")

2016-05-30 Thread Ken Burgett via swift-users
ext file I/O with Swift 3 (Quinn "The Eskimo!") -- Message: 1 Date: Mon, 30 May 2016 09:11:41 +0100 From: "Quinn \"The Eskimo!\"" <eski...@apple.com> To: Swift Users List <swift-users@swift

Re: [swift-users] Simple text file I/O with Swift 3

2016-05-30 Thread Quinn "The Eskimo!" via swift-users
On 28 May 2016, at 19:05, Ken Burgett via swift-users wrote: > print(buf) The trick here is to replace the above line with: print(String(validatingUTF8: buf)) `fgets` sets up `buf` to hold a C string, so you have to convert it to a Swift string. How do you do

[swift-users] Simple text file I/O with Swift 3

2016-05-28 Thread Ken Burgett via swift-users
Hi all, I am trying to understand how Swift 3 File I/O works in a linux environment. I put together a trivial test program using what I can glean from the few examples I can find. See below. === import Glibc import Foundation let filename = Process.arguments[1]