<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi,</div><div class="">The place to start is with the unusually named ‘os_file’</div><div class="">If you get it, you will find it has two important traits, ‘traits unixFile’ which in turn delegates to ‘traits abstractFile’</div><div class="">These have methods for opening, reading and writing from files (and also sockets). </div><div class="">Basically start with os_file and look upwards at its parents.</div><div class=""><br class=""></div><div class="">As a simple example:</div><div class=""><br class=""></div><div class="">| f |</div><div class="">f: os_file openForReading: ‘myfile.txt’ IfFail: [|:e | ^ ‘Oh no! Something went wrong’ ].</div><div class="">[f atEnd] whileFalse: [</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>f readLine printString].</div><div class="">f close</div><div class=""><br class=""></div><div class="">Hope this helps,</div><div class="">Russell</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On 8 Jun 2015, at 1:18 am, <a href="mailto:ddp@electric-loft.org" class="">ddp@electric-loft.org</a> [self-interest] <<a href="mailto:self-interest@yahoogroups.com" class="">self-interest@yahoogroups.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div id="ygrp-mlmsg" style="font-size: 13px; font-family: Arial, helvetica, clean, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); position: relative;" class=""><div id="ygrp-msg" style="line-height: 1.22em; z-index: 1;" class=""><div id="ygrp-text" style="line-height: 1.22em; font-family: Georgia;" class=""><div style="line-height: 1.22em; margin: 0px 0px 1em;" class=""><br class="webkit-block-placeholder"></div><p style="line-height: 1.22em; margin: 0px 0px 1em;" class="">What's the recommended way to access file streams in Self?  The section in the 4.5 Handbook on I/O and Unix is a little light.  I'm on OS X.</p><div style="line-height: 1.22em; margin: 0px 0px 1em;" class=""><br class="webkit-block-placeholder"></div></div><div style="line-height: 1.22em; color: rgb(255, 255, 255); height: 0px;" class=""></div></div></blockquote></div><br class=""></body></html>