On 25 Nov 2011, at 09:27, Sven Van Caekenberghe wrote:
For scripting purposes, I would like to use/control the VM exit status/value (on Linux).
There is SmalltalkImage>>#snapshot:andQuit: but there is nothing there that indicates that one can set the process exit status. Is there a way to do that ?
Has anyone a good idea on how the CogVM could communicate back to its invoking script whether is ran OK or not ?
I think I found something else that might be helpful, but I have not yet worked it out fully. Basically using the #stdout stream in 1.3 it is very easy to generate ouput (this is really a very cool feature!). This script will produce either 'OK' or 'FAILED' depending on the #signalling (and produce a PharoDebug.log file as well): FileStream stdout wantsLineEndConversion: true. [ Error signal: 'Something went terribly wrong'. FileStream stdout nextPutAll: 'OK'; cr. ] on: Error do: [ :exception | Smalltalk logError: exception description inContext: exception signalerContext. FileStream stdout nextPutAll: 'FAILED'; cr. ]. Smalltalk snapshot: false andQuit: true. The problem with this technique is that you cannot use stdout for anything else. Sven