[squeak-dev] Xtreams files

Sven Van Caekenberghe sven at beta9.be
Tue Oct 12 20:54:26 UTC 2010


On 12 Oct 2010, at 21:26, Nicolas Cellier wrote:

> I added a hook to Xtreams files this evening.
> The hook by now is in FileDirectory (no comment... I'll be happy when
> a replacement is integrated in Squeak/Pharo).
> 
> ((FileDirectory default / 'toto.txt') writing encoding: #ascii) write:
> 'hello world'; close.
> ((FileDirectory default / 'toto.txt') reading encoding: #ascii) rest.
> 
> I didn't hook into StandardFileStream, but rather a simplified version
> of David Lewis IOHandle.
> I separated this stuff in Xtreams-SqueakExternals.
> Anyway, this is not really related to Xtreams, most of the
> functionality should be in core (apart reading/writing/appending which
> might better return in Xtreams-Terminals).
> 
> I also slighlty modified XTFileReadStream and XTFileWriteStream to fit
> some Squeak specific API.
> Maybe I could have just used the VW API and provide compatibility
> layer... We'll see later.
> 
> Nicolas

Thanks again, Nicolas, it is impressive to see you make so much progress.

For me, all UTF16 tests seem to fail. These tests have the following code:

	Smalltalk isBigEndian ifTrue: [
		bytes := (bytes reading transforming: [ :in :out || first | first := in get. out put: in get; put: first ]) rest ].

In my image, Smalltalk isBigEndian is false, but it seems that the switching should have been done. If I force it in the debugger, the tests would succeed as far as I can see.

Sven





More information about the Squeak-dev mailing list