[Glass] Problems managing files from Pharo and GemStone

Mariano Martinez Peck marianopeck at gmail.com
Tue Apr 15 08:49:26 PDT 2014


Ok. It seems that in GemStone GsFile only accepts 0-255 range so I need to
pre-encode strings. Something like this:

myfile := GsFile openWrite: self filename.
myfile nextPutAll: 'myRootObject' sixxString encodeAsUTF8.
myfile close.

is this the way that it should be done in GemStone?

Thanks,


On Tue, Apr 15, 2014 at 12:27 PM, Mariano Martinez Peck <
marianopeck at gmail.com> wrote:

> Hi guys. I don't understand why I have just faced this problem now and not
> before...but... I am writing a text file (sixx serialization) in GemStone
> this way:
>
> FileStream forceNewFileNamed: 'test' do: [:str | str nextPutAll:
> 'whateverRootObject' sixxString ].
>
> And then in Pharo I read like:
>
> SixxShapeChangeReadStream on: (FileStream oldFileNamed: 'test')
>
> For some files, the above works OK. But for other files, while reading in
> Pharo I get a: "UTF8Error: Invalid UTF8 input detected"
>
> The problem is that FileStream oldFileNamed: in Pharo answers a
> MultiByteFileStream, which uses a UTF8TextConverter. Hence, in
> UTF8TextConverter >> nextFromStream:  I get an error because 'unicode'
> instVar is nil.
>
> Of course, if in Pharo I use directly a StandardFileStream oldFileNamed:
> (to avoid using MultiByteFileStream) I can indeed read those files.
>
> So...how should I make this to work in GemStone and Pharo? I know Johan
> ported the text converters and MultiByteBinaryOrTextStream. But I don't
> know how to get a similar MultiByteFileStream for GemStone.
>
> Thanks in advance,
>
> --
> Mariano
> http://marianopeck.wordpress.com
>



-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20140415/c5f17d34/attachment.html>


More information about the Glass mailing list