About using squeak to script...

David T. Lewis lewis at mail.msen.com
Sat Aug 12 13:47:14 UTC 2006


On Sat, Aug 12, 2006 at 11:53:37AM +0200, Lukas Renggli wrote:
> >> 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!
> 
> The problem is, that something like stdout, stdin and stderr does not
> exist on all platforms.

OSProcess thisOSProcess stdOut
OSProcess thisOSProcess stdErr
OSProcess thisOSProcess stdErr

This works on Unix/Linux/OS X. It used to work on Windows, but I think
this was broken with some recent security enhancments (sic) to the
Windows VM FilePlugin.

OSProcess is organized such that platform-specific subclasses implement
the OS dependent stuff. It's intended to be extended for any platform.
Likewise for the OSPP plugin, the platform-specific subclasses are
generated for different platforms. Currently this is Unix (which covers
Linux and OS X) and Windows, although the Windows version is not
distributed with VM downloads (rightly so, given that it is no longer
compatible with the security features of the Windows VM).

I'm not necessarily planning to actually do any other platform extensions,
but please feel free to extend it in any way you want. I try to keep
things backward compatible, so you would be fairly safe in doing
your own platform-specific subclasses it you want.

Dave




More information about the Squeak-dev mailing list