#BUGFIX by sr
authorsr
Fri, 02 Sep 2016 13:49:08 +0200
changeset 20336 9b11122ce38b
parent 20335 15c91da89b22
child 20337 8ea0078f0179
#BUGFIX by sr class: AbstractOperatingSystem added: #executeCommand:inputFrom:outputTo:errorTo:inDirectory:lineWise:showWindow:onError:
AbstractOperatingSystem.st
--- a/AbstractOperatingSystem.st	Fri Sep 02 13:28:08 2016 +0200
+++ b/AbstractOperatingSystem.st	Fri Sep 02 13:49:08 2016 +0200
@@ -1927,6 +1927,35 @@
 	onError:aBlock
 !
 
+executeCommand:aCommandString inputFrom:anInStream outputTo:anOutStream errorTo:anErrStream inDirectory:dirOrNil lineWise:lineWise showWindow:showWindow onError:aBlock
+    "execute the unix command specified by the argument, aCommandString.
+     If aCommandString is a String, the commandString is passed to a shell for execution
+     - see the description of 'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual).
+     If aCommandString is an Array, the first element is the command to be executed,
+     and the other elements are the arguments to the command. No shell is invoked in this case.
+     Return true if successful, the value from aBlock if not.
+     If not successfull, aBlock is called with an OsProcessStatus
+     (containing the exit status) as argument.
+     The given in, out and err streams may be arbitrary (Smalltalk-) streams;
+     if any is not an external stream (which is required by the command),
+     extra pipes and shuffler processes are created, which stuff the data into
+     those internal stream(s).
+     Nil stream args will execute the command connected to ST/X's standard input, output or
+     error resp. - i.e. usually, i/o will be from/to the terminal"
+
+    ^ self
+        executeCommand:aCommandString
+        inputFrom:anInStream
+        outputTo:anOutStream
+        errorTo:anErrStream
+        auxFrom:nil
+        environment:nil
+        inDirectory:dirOrNil
+        lineWise:lineWise
+        showWindow:showWindow
+        onError:aBlock
+!
+
 executeCommand:aCommandString inputFrom:anInStream outputTo:anOutStream errorTo:anErrStream inDirectory:dirOrNil onError:aBlock
     "execute the unix command specified by the argument, aCommandString.
      If aCommandString is a String, the commandString is passed to a shell for execution