About using squeak to script...

Lukas Renggli renggli at gmail.com
Sat Aug 12 09:19:12 UTC 2006


> I would like to use I would like to pass a file as argument, I know
> that this is possible and I should read the manual. ;) any hints is welcome.

Simply pass the arguments after the image-name, that should work with
the Unix and the Mac VM. By default the image will try to file-in the
first argument (it assumes it is a script), so you probably need to
change that (somewhere in a start-up method) an put your own parse
code in there. The code "SmalltalkImage current extractParameters"
answers a collection of command line parameters.

> What I do not know is how can I print on stdoutput?
> Should I create a primitive (argh) for that?
> Would be neat to have that per default (may be this is the time for
> me to learn something new writing
> a primitive)

As far as I know this only works on the Unix VM with OS Process.

Once I wrote a plugin for Squeak to directly access the Posix
filesystem functions on Unix, because of the bugs with file-access in
Squeak. This also allowed to read and write to stdout, stdin and
stderr by performing the primitives on the file-handles 0, 1 and 2
respectively. I can show you that code if you like.

Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch



More information about the Squeak-dev mailing list