#FEATURE by cg
class: AbstractOperatingSystem
added: #executeCommand:inDirectory:showWindow:
--- a/AbstractOperatingSystem.st Tue Oct 18 12:35:27 2016 +0200
+++ b/AbstractOperatingSystem.st Tue Oct 18 16:07:00 2016 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 1988 by Claus Gittinger
All Rights Reserved
@@ -15,8 +17,8 @@
Object subclass:#AbstractOperatingSystem
instanceVariableNames:''
- classVariableNames:'ConcreteClass LastErrorNumber LocaleInfo OSSignals PipeFailed
- ErrorSignal Resources'
+ classVariableNames:'ConcreteClass ErrorSignal LastErrorNumber LocaleInfo OSSignals
+ PipeFailed Resources'
poolDictionaries:''
category:'System-Support'
!
@@ -1302,6 +1304,29 @@
"Modified: / 10.11.1998 / 20:54:37 / cg"
!
+executeCommand:aCommandString inDirectory:aDirectory showWindow:showWindow
+ "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, false otherwise."
+
+ ^ self
+ executeCommand:aCommandString
+ inputFrom:nil
+ outputTo:nil
+ errorTo:nil
+ auxFrom:nil
+ environment:nil
+ inDirectory:aDirectory
+ lineWise:false
+ showWindow:showWindow
+ onError:[:exitStatus| false]
+
+ "Created: / 18-10-2016 / 15:55:29 / cg"
+!
+
executeCommand:aCommandString inputFrom:anInStream outputTo:anOutStream errorTo:anErrStream
"execute the unix command specified by the argument, aCommandString.
If aCommandString is a String, the commandString is passed to a shell for execution