<div dir="ltr"><div>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: <a href="https://github.com/apple/swift/blob/master/stdlib/public/Platform/glibc.modulemap.gyb">https://github.com/apple/swift/blob/master/stdlib/public/Platform/glibc.modulemap.gyb</a></div><div><br></div>OO wrappers around things like I/O are provided by the open source version of Foundation: <a href="https://github.com/apple/swift-corelibs-foundation">https://github.com/apple/swift-corelibs-foundation</a> and, to the extent that their functionality matches the proprietary macOS version, there's documentation at <a href="https://developer.apple.com/reference/foundation/">https://developer.apple.com/reference/foundation/</a><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Jacob<br></div></div></div></div>
<br><div class="gmail_quote">On Sat, Jul 16, 2016 at 4:33 PM, K Richard Pixley via swift-users <span dir="ltr"><<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
I'm a new swift person, <i>long</i> 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.<br>
<br>
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 in the
swift standard library, (aside from print()). And I don't see
anything in the way of documentation for the Core Library.<br>
<br>
How do I do i/o in swift?<br>
<br>
I'm not thinking in terms of "an app", just a simple, read from
stdin, write to stdout filter. How?<br>
<br>
Pointers welcome.<br>
<br>
--rich<br>
</div>
<br>_______________________________________________<br>
swift-users mailing list<br>
<a href="mailto:swift-users@swift.org">swift-users@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br>
<br></blockquote></div><br></div></div>