[Pharo-project] Unix thing? Possible silent failure writing file.

Sven Van Caekenberghe sven at beta9.be
Mon Nov 15 14:06:34 CET 2010


Bill,

On 15 Nov 2010, at 13:35, Schwab,Wilhelm K wrote:

> Apologies if this comes through as a repeat.
> 
> What is so mysterious/non-responsive about telling you (read the initial email) that I was re-writing an existing file, nothing happened, no errors were reported, and that repeating it with an explicit truncation of the file after opening gave the expected behavior?

What others on this list are saying is that you have to provide _Concrete Code Examples_ independent from all decoration (it doesn't matter that you are using R and doing whatever with it). Making a good, short example that others can run will help you and others. You have to make at least the isolation effort first. Even better, you should look as deep into it as you can. Otherwise you will be ignored because you are asking others to do your work.

So, you should have written something like (but maybe this is not what you meant or were using/doing):

Shouldn't FileStream>>#fileNamed:do: raise an error when overriding ? 

For example:

FileStream fileNamed: '/tmp/foo.txt' do: [ :stream | stream nextPutAll: 'First'; crlf ].

"works"

FileStream fileNamed: '/tmp/foo.txt' do: [ :stream | stream nextPutAll: 'Second'; crlf ].

"overwrites - but should fail IMHO"

FileStream oldFileNamed: '/tmp/foo.txt' do: [ :stream | stream nextPutAll: 'Third'; crlf ].

"overwrites"

FileStream newFileNamed: '/tmp/foo.txt' do: [ :stream | stream nextPutAll: 'Fourth'; crlf ].

"raises error"

HTH,

Sven

PS: And I also think you should make an Google Code Issue when you are sure there is a bug ;-)






More information about the Pharo-project mailing list