headless version for Unix
Lex Spoon
lex at cc.gatech.edu
Fri Jan 22 20:08:06 UTC 1999
Miles Fidelman <mfidelman at ntcorp.com> wrote:
> Thanks Georg,
>
> > >So... I was wondering if anybody has tried any kind of headless port to
> > >the Unix environment.
> >
> > Compile with -DHEADLESS and you are set. For further information go to
> > http://macos.tuwien.ac.at:9009/Server.home and search for "headless".
>
> The archive was very helpful, but raised another question: is there an
> easy way to configure a headless Squeak to startup taking commands from
> stdin and writing a transcript to stdout?
>
For the executing commands part, there are three main ways:
1) add code to SystemDictionary>>processStartUpList. The code will execute when the image starts. (and also after a snapshot....)
2) from a workspace, execute something like the following (be sure to highlight the whole thing before hitting "do-it"):
Smalltalk snapshot: true andQuit: true. myObject doMyStuff.
3) add a small hook to SystemDictionary>>processStartUpList such that, if a filename is specified on Squeak's command line, then file in the specified file.
For output, many systems will let you access stdout as a special file like /dev/stdout. If that's not available on your particular Unix, you can still write to a file and do a "tail -f" on it.
Overall, Squeak seems good at executing arbitrary smalltalk code, but it doesn't play so well as a generic Unix utility because of its inability to use stdin and stdout.
Lex
More information about the Squeak-dev
mailing list
|