[self-interest] file streams
mail at russell-allen.com
Tue Jun 9 01:04:24 UTC 2015
The place to start is with the unusually named ‘os_file’
If you get it, you will find it has two important traits, ‘traits unixFile’ which in turn delegates to ‘traits abstractFile’
These have methods for opening, reading and writing from files (and also sockets).
Basically start with os_file and look upwards at its parents.
As a simple example:
| f |
f: os_file openForReading: ‘myfile.txt’ IfFail: [|:e | ^ ‘Oh no! Something went wrong’ ].
[f atEnd] whileFalse: [
f readLine printString].
Hope this helps,
> On 8 Jun 2015, at 1:18 am, ddp at electric-loft.org [self-interest] <self-interest at yahoogroups.com> wrote:
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Self-interest