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

Perry E. Metzger perry at piermont.com
Wed Dec 9 11:49:16 CST 2015


On Wed, 9 Dec 2015 09:36:01 -0800 Jens Alfke <jens at mooseyard.com>
wrote:
> > A lower layer is also needed -- simple Swifty wrappers for the
> > Unix system calls so that Swift implementations can get at them
> > without having to use unsafe constructs. open(2), read(2),
> > write(2), lseek(2) and close(2) would provide about 75% of what
> > one needs for the higher layer stuff (and everything one would
> > want for stdio) with quite minimal hacking.
> 
> I agree, but I foresee problems in the future when Swift is ported
> to Windows. :/

I'm a big believer in not prematurely generalizing an implementation.
APIs last a long time, implementations can be redone later. :)

-- 
Perry E. Metzger		perry at piermont.com


More information about the swift-users mailing list