[swift-users] Pure Swift, cross platform way to open, read/write files?

Jens Alfke jens at mooseyard.com
Wed Dec 9 00:54:23 CST 2015

> On Dec 8, 2015, at 8:45 PM, Greg Skluzacek via swift-users <swift-users at swift.org> wrote:
> One would surely think that a programing language as nifty and cool as Swift would have a easy way to read files. Maybe its obvious and I just am missing it.

File I/O isn’t usually part of a language, it’s part of a library. Until now Swift has been able to depend on the Foundation framework, which includes APIs for files. Taking Swift cross-platform severed it from the Cocoa frameworks, so one of the resulting challenges is to create cross-platform libraries to do basic things like file I/O. Those are in development (the Core Libraries project.)

(Another hole in the standard library is that it’s ridiculously complex to create a String from a UTF-8 encoded byte array without “cheating” and using Foundation’s NSString API.)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20151208/483e6ea1/attachment.html>

More information about the swift-users mailing list