On 31 August 2012 17:23, Igor Stasenko <[email protected]> wrote:
> On 31 August 2012 18:00, Frank Shearar <[email protected]> wrote:
>> On 31 August 2012 16:43, Igor Stasenko <[email protected]> wrote:
>>> On 31 August 2012 08:10, Frank Shearar <[email protected]> wrote:
>>>> On 31 August 2012 05:04, Dale Henrichs <[email protected]> wrote:
>>>>> Frank,
>>>>>
>>>>> I'll try to get the Pharo-2.0 build for builderCI working soon ...
>>>>
>>>> I _think_ it'll be as simple as figuring out how to say "open this
>>>> file, creating it first if necessary" in FileSystem-speak. I realise
>>>> you've not done Metacello+Pharo2 yet, and asked on list hoping that
>>>> one of the FS folk would pipe up with something :)
>>>>
>>>
>>> 'asdasd' asFileReference writeStreamDo: [:s |
>>>         s nextPutAll: 'baz' ]
>>
>> But for reading? My debug output's here:
>>
>>     http://travis-ci.org/#!/frankshearar/Control/jobs/2288671
>>
> reading non-existent file?
>
> you know, you can always test if file exists before trying to open it.

I had mentioned that in the original mail.

> ref := 'asdasd' asFileReference.
> (ref exists and: [ ref isFile and: [ ref isReadable ]]) ifTrue: [ ref
> readStream  ....]
>
> i never used FS before.. so to post the code above, i vent to system browser,
> and read some method names in FileReference class.
> 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

>> 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.

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.

frank

>> where transcriptFileName = 'TravisTranscript.txt'.
>>
>> The "old style" file handling works, and says this:
>>
>>     transcriptStream := fileDirectoryClass default newFileNamed:
>> transcriptFileName
>>
>> frank
>>
>>>> frank
>>>>
>>>>> Dale
>>>>>
>>>>> ----- Original Message -----
>>>>> | From: "Frank Shearar" <[email protected]>
>>>>> | To: "Pharo Development" <[email protected]>
>>>>> | Cc: "Dale Henrichs" <[email protected]>
>>>>> | Sent: Thursday, August 30, 2012 1:52:37 PM
>>>>> | Subject: Pharo 2.0 + Travis = ?
>>>>> |
>>>>> | Hi Dale,
>>>>> |
>>>>> | I'm getting a build failure against Pharo 2.0 [1] with the error
>>>>> | "FileDoesNotExist:
>>>>> | 
>>>>> /home/travis/dalehenrich-builderCI-cd2facd/builds/travisCI/TravisTranscript.txt".
>>>>> |
>>>>> | I think that's because the before.st says "transcriptStream :=
>>>>> | ((Smalltalk at: #FileSystem) workingDirectory / transcriptFileName)
>>>>> | readStream ]" and that file doesn't exist.
>>>>> |
>>>>> | Is there a convenient way of saying "please open a readStream on this
>>>>> | file and, if it's not there, make one" ?
>>>>> |
>>>>> | (If one semi-replicates the build, by opening a Pharo 2.0 image,
>>>>> | manually loading the ConfigurationOfControl, and running
>>>>> | "ConfigurationOfControl loadDevelopment", one will see Control
>>>>> | 1.1.dev
>>>>> | running with a green light for Pharo 2.0!)
>>>>> |
>>>>> | frank
>>>>> |
>>>>> | [1] http://travis-ci.org/#!/frankshearar/Control/jobs/2282004
>>>>> |
>>>>
>>>
>>>
>>>
>>> --
>>> Best regards,
>>> Igor Stasenko.
>>>
>>
>
>
>
> --
> Best regards,
> Igor Stasenko.
>

Reply via email to