How to access stdout on Mac OS X when using open

John M McIntosh johnmci at smalltalkconsulting.com
Thu Jul 26 10:17:27 UTC 2007


If you did open "Squeak 3.8.18beta1U.app"
that will not work, the open command forks off the process.
If you look in your console.log you should confirm you see the 'Hello  
World'

If you want to launch the binary in a terminal session and keep  
control of the stdin/stdout you must do

./Squeak\ 3.8.18beta1U.app/Contents/MacOS/Squeak\ VM\ Opt

That likely will print these two messages

2007-07-26 03:13:54.252 Squeak VM Opt[7642] CFLog (0): CFMessagePort:  
bootstrap_register(): failed 1103 (0x44f), port = 0x2803,  
name'org.squeak.Squeak.ServiceProvider'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2007-07-26 03:13:54.256 Squeak VM Opt[7642] CFLog (99):  
CFMessagePortCreateLocal(): failed to name Mach port  
(org.squeak.Squeak.ServiceProvider)


And then your test gives.


Hello World


For the curious if you you do

./Squeak\ 3.8.18beta1U.app/Contents/MacOS/Squeak\ VM\ Opt -help

it will print

Usage: ./Squeak 3.8.18beta1U.app/Contents/MacOS/Squeak VM Opt  
[<option>...] [<imageName> [<argument>...]]
        ./Squeak 3.8.18beta1U.app/Contents/MacOS/Squeak VM Opt  
[<option>...] -- [<argument>...]

Common <option>s:
   -help                 print this help message, then exit
   -memory <size>[mk]    use fixed heap size (added to image size)
   -pathenc <enc>        set encoding for pathnames (default: macintosh)
   -headless             run in headless (no window) mode (default:  
false)

Notes:
   <imageName> defaults to `Squeak.image'.
   If `-memory' is not specified then the heap will grow dynamically.
   <argument>s are ignored, but are processed by the Squeak image.
   The first <argument> normally names a Squeak `script' to execute.
   Precede <arguments> by `--' to use default image.

Unix users may feel warm and fuzzy then.....


On Jul 26, 2007, at 1:02 AM, Serge Stinckwich wrote:

> OSProcess thisOSProcess stdOut nextPutAll: 'Hello World'

--
======================================================================== 
===
John M. McIntosh <johnmci at smalltalkconsulting.com>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
======================================================================== 
===





More information about the Squeak-dev mailing list