PackageDescription: Standard IO Streams


Standard IO Streams

Last published: September 6, 2005 by 'bobw'

Defines 4 Classes
Extends 9 Classes


This package defines three globals in the OS namespace, Stdout, Stdin and Stderr These globals are streams on stdout, stdin and stderr It is intended to only be used along with VisualWorks 7.3 and later releases. Once you have loaded this package you'll need to save and restart the image. If you are running on windows, be sure that you are using vwntconsole.exe, otherwise the handles can not be created.

To write to Stdout do something like:

OS.Stdout nextPutAll: Timestamp now printString; cr

Or:

OS.Stdout lockWhile:
[OS.Stdout
nextPutAll: 'testing';
cr;
nextPutAll: 'testing';
cr;
nextPutAll: '123' ; cr]

Stdin can be read like this (on windows, do CTRL-Z in the console to end the stream):

[Stdin atEnd]
whileFalse: [Stdout nextPut: Stdin next asUppercase]