OSProcess.st
changeset 22985 da550df21477
parent 22984 e8fd046ea3ba
child 22986 6574facad5bf
--- a/OSProcess.st	Tue May 22 12:05:07 2018 +0200
+++ b/OSProcess.st	Tue May 22 12:24:27 2018 +0200
@@ -424,6 +424,8 @@
 !
 
 outStream
+    "the stream where the stdout output of the command is directed to"
+
     ^ outStream
 
     "Created: / 10.11.1998 / 21:26:34 / cg"
@@ -441,10 +443,6 @@
     ^ pid
 !
 
-pid:something
-    pid := something.
-!
-
 showWindow
     ^ showWindow
 !
@@ -466,13 +464,23 @@
 !
 
 terminateActionBlock
+    "the (user provided) callback block,
+     that will be executed when the command has finished or was terminated.
+     If non-nil, it will be called with optional argument:status and:self, the OSProcess."
+
     ^ terminateActionBlock
+
+    "Modified (comment): / 22-05-2018 / 12:21:24 / Claus Gittinger"
 !
 
 terminateActionBlock:aBlock
-    "set the block that will be executed when the command has been finished or terminated."
+    "set the callback block,
+     that will be called when the command has finished or was terminated.
+     If non-nil, it will be called with optional argument:status and:self, the OSProcess."
 
     terminateActionBlock := aBlock.
+
+    "Modified (comment): / 22-05-2018 / 12:21:12 / Claus Gittinger"
 ! !
 
 !OSProcess methodsFor:'initialization'!
@@ -695,7 +703,7 @@
 
     "/ UserPreferences current logExecutedOSCommands:true
     UserPreferences current logExecutedOSCommands ifTrue:[
-        Transcript showCR:('OS command: ',self startCommand asString).  
+        Transcript showCR:('OS command: ',self startCommand printString).  
     ].
     
     Processor 
@@ -724,7 +732,9 @@
                 "/ ].
                 
                 finishSema signal.
-                terminateActionBlock value.
+                terminateActionBlock notNil ifTrue:[
+                    terminateActionBlock valueWithOptionalArgument:status and:self.
+                ].
             ].
         ].
 
@@ -744,6 +754,8 @@
     ].
 
     ^ true.
+
+    "Modified: / 22-05-2018 / 12:23:48 / Claus Gittinger"
 ! !
 
 !OSProcess methodsFor:'terminating'!