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

Brent Royal-Gordon brent at architechies.com
Tue Dec 8 22:55:37 CST 2015


> But at the same time I get your point just use #if #else #endif to conditional import / call functions... but coding like that doesn't seem vary fun... reminds me of looking a C code that was meant to be compiled on different processor architectures. :-( 

I would really like to see Swift offer a “POSIX” or “LibC” module which would import whatever the current platform offered for a C library. Obviously there would be differences between Glibc and Darwin.C, and I wouldn’t expect Swift to try to paper those over, but this `#if os` dance in every file is kind of ridiculous.

-- 
Brent Royal-Gordon
Architechies



More information about the swift-users mailing list