#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Thu, 01 Sep 2016 15:59:40 +0200
changeset 20320 ccc9f6fdd5a7
parent 20319 f89e5761fc88
child 20321 19a908d0e4d4
#FEATURE by cg class: AbstractOperatingSystem added: #exec:withArguments:environment:fileDescriptors:fork:newPgrp:inDirectory:showWindow: #exec:withArguments:showWindow: changed: #exec:withArguments:environment:fileDescriptors:fork:newPgrp:inDirectory:
AbstractOperatingSystem.st
--- a/AbstractOperatingSystem.st	Wed Aug 31 18:34:29 2016 +0200
+++ b/AbstractOperatingSystem.st	Thu Sep 01 15:59:40 2016 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1988 by Claus Gittinger
 	      All Rights Reserved
@@ -862,6 +864,17 @@
 exec:aCommandPath withArguments:argArray environment:env fileDescriptors:fds fork:doFork newPgrp:newGrp inDirectory:aDirectory
     "execute an OS command"
 
+    ^ self 
+        exec:aCommandPath withArguments:argArray environment:env fileDescriptors:fds fork:doFork 
+        newPgrp:newGrp inDirectory:aDirectory showWindow:nil
+
+    "Created: / 12.11.1998 / 14:46:15 / cg"
+!
+
+exec:aCommandPath withArguments:argArray environment:env fileDescriptors:fds fork:doFork 
+                  newPgrp:newGrp inDirectory:aDirectory showWindow:showWindowBooleanOrNil
+    "execute an OS command"
+
     ^ self subclassResponsibility
 
     "Created: / 12.11.1998 / 14:46:15 / cg"
@@ -2338,6 +2351,28 @@
     "Created: / 28.1.1998 / 14:14:03 / md"
     "Modified: / 28.1.1998 / 14:14:45 / md"
     "Modified: / 12.11.1998 / 14:45:06 / cg"
+!
+
+exec:aCommandPath withArguments:argArray showWindow:showWindowBooleanOrNil
+    "execute the OS command specified by the argument, aCommandPath, with
+     arguments in argArray (no arguments, if nil).
+     If successful, this method does NOT return and smalltalk is gone.
+     If not successful, it does return.
+     Can be used on UNIX with fork or on other systems to chain to another program."
+
+    ^ self
+        exec:aCommandPath
+        withArguments:argArray
+        environment:nil
+        fileDescriptors:#(0 1 2)
+        fork:false
+        newPgrp:false
+        inDirectory:nil
+        showWindow:showWindowBooleanOrNil
+
+    "/ never reached ...
+
+    "Modified: / 12.11.1998 / 14:44:26 / cg"
 ! !
 
 !AbstractOperatingSystem class methodsFor:'file access'!