Problem with streams and files :(

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Problem with streams and files :(

Mariano Martinez Peck
Hi folks! I know very little about streams and files, so maybe is quite stupid my problem. Try to evaluate this code:

|segment|

segment := ImageSegment new.
segment copyFromRoots: (Array with: 'something')
sizeHint: 100000 areUnique: true.
segment segmentName: 'segmenttest'.
(ImageSegment segmentDirectory newFileNamed: 'whatever') nextPutAll: segment segment.

You will raise the error: "Improper store into indexable object"

So, I am using a MultiByteFileStream and I am trying to write a WordArrayForSegment.

I don't understand  MultiByteFileStream>>nextPut: aCharacter 
because it does:


nextPut: aCharacter
    aCharacter isInteger ifTrue: [^ super nextPut: aCharacter].
xxxx....xxxxx

And super is   MultiByteFileStream >> nextPut: aChar     which does

buffer1 at: 1 put: char.

But here, char is not a char, but 1929386344 which is a LargePositiveInteger

and then, of course, it fails when it does     buffer1 at: 1 put: char.

So, does someone have an idea of what can be wrong ?

Thanks a lot in advance,

Mariano





_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project