On 31 August 2012 18:54, Frank Shearar <frank.shearar@gmail.com> wrote:
This is something what you can do by yourself, isn't? :)
Sure. And maybe I would have, if I didn't first have to get a Pharo 2.0 image and then install it and then figure out the various new APIs and so on and so on. So instead I wimped out and asked a clear question in a place where the experts on the relevant APIs would have a chance to see it :P
i lost in negations :) clearly, i am not an expert in FS API (as most of others here).
and the relevant code (I think) is
transcriptStream := ((Smalltalk at: #FileSystem) workingDirectory / transcriptFileName) readStream
so, why you don't just wrap this thing with exception handler?
[ transcriptStream := ((Smalltalk at: #FileSystem) workingDirectory / transcriptFileName) readStream
] on: Error do: [ aha... somethign wrong with that file ]
this will prevent image from bailing out to OS. :)
Well, no. Catching Error is a terrible idea. I'll just touch the file if it doesn't already exist.
so, then, following Sean's rule, it should be something beautiful like: 'bajsjn' asFileReference touch. Because i understood your question ("please open a readStream on this file and, if it's not there, make one") as: - if file exists, open it for reading and read smthng - if file doesn't exists create it (but apparently there will be nothing to read from)
Thanks for taking the trouble to answer the question, Igor. If it's any consolation, this means Dale & I can get our CI stuff working for Pharo 2.0 that must quicker.
yes, that would be nice consolation :)
frank
-- Best regards, Igor Stasenko.