[BUG] ([closed] non-issue)

stéphane ducasse ducasse at iam.unibe.ch
Sat Jul 16 15:45:49 UTC 2005


  I could not find how to open the MultiByteBinaryOrTextStream as a  
readstream...
because may be this would have solved my problem....

Stef


On 14 juil. 05, at 23:38, radoslav hodnicak wrote:

>
> Well this seems to be a property of write streams, they pretend to  
> be empty and if you #nextPut: it will overwrite your old data (if  
> you use #with: to create the stream it will append data). This  
> allows you to do things like
>
> string := 'Abcdefg' copy.
> stream := WriteStream on: string.
> stream nextPutAll: '123'.
> string -> '123defg'
>
> I have no idea where this would be useful, especially since stream  
> will expand the collection in steps as you add new items so you end  
> up with data + empty cells. Streams in VisualWorks behave the same,  
> so it's not just some Squeak oddity
>
> rado
>
> On Wed, 13 Jul 2005, Larry Trutter wrote:
>
>
>> This report is being closed because I could not successfully  
>> replicate this issue without more information. You are welcome to  
>> resubmit the issue to the Mantis database with any more  
>> information that you can to aid us in understanding and  
>> replicating the problem at http://bugs.impara.de/ .
>>
>> thank you for your time,
>> Larry Trutter
>>
>> Stéphane Ducasse wrote:
>>
>>
>>> hi all
>>> can someone help me here?
>>> I did the following
>>> |stream |
>>> stream := (MultiByteFileStream fileNamed: 'BD4TabsDelimited.txt').
>>> stream converter: MacRomanTextConverter new.
>>> self assert: (stream upTo: Character cr) =  '        Achille  
>>> Talon     Greg Pas de pitié pour Achille talon    13    1976      
>>> Dargaud    "sur la couverture ""une histoire du journal   
>>> tintin"""            '
>>> This is ok!
>>> Now I'm trying to use MultiByteBinaryOrTextStream as follow
>>> |stream |
>>> stream := MultiByteBinaryOrTextStream on: self  
>>> completeWithTabbingLinesWithAccents encoding: 'mac-roman'.
>>> self assert: (stream upTo:  Character cr) = ' '
>>> when I do
>>> stream contents I got '' while there is a collection...
>>> It seems that the stream once instantiated is at the end.  
>>> (readLimit  is 0 when the instance is created)
>>> How can I say to the stream to be at the start. I tried reset,  
>>> resetAtStart without success
>>> when in an inspector I copy the writeLimit to the readLimit then   
>>> upTo: works perfectly.
>>> Is it a bug?
>>> I added
>>> MultiByteBinaryOrTextStream>>atStart
>>>     readLimit := writeLimit.
>>>     position := 0.
>>> and it works but this seems to me quite strange that I cannot  
>>> open a MultiByteBinaryOrTextStream
>>> in read and be at the beginning of the stream
>>> Stef
>>>
>>
>>
>
>




More information about the Squeak-dev mailing list