About using squeak to script...

stéphane ducasse ducasse at iam.unibe.ch
Sat Aug 12 09:42:34 UTC 2006


On 12 août 06, at 11:19, Lukas Renggli wrote:

>> 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.

Yes I want to see that.
I think that having a StdOut class as in VW is realllllly cool.
This way we can really use squeak to script!


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




More information about the Squeak-dev mailing list