#FEATURE by cg
class: UnixOperatingSystem
added: #startProcess:inputFrom:outputTo:errorTo:auxFrom:environment:inDirectory:newPgrp:showWindow:
changed: #startProcess:inputFrom:outputTo:errorTo:auxFrom:environment:inDirectory:showWindow:
--- a/UnixOperatingSystem.st Tue Nov 08 20:17:32 2016 +0100
+++ b/UnixOperatingSystem.st Tue Nov 08 20:17:39 2016 +0100
@@ -3652,7 +3652,7 @@
startProcess:aCommandString inputFrom:anExternalInStream outputTo:anExternalOutStream
errorTo:anExternalErrStream auxFrom:anAuxiliaryStream
- environment:anEvironmentDictionary inDirectory:dir showWindow:ignoredHere
+ environment:anEvironmentDictionary inDirectory:dir newPgrp:newPgrp showWindow:ignoredHere
"start executing the OS command as specified by the argument, aCommandString
as a separate process; do not wait for the command to finish.
@@ -3696,7 +3696,7 @@
with:err fileDescriptor
with:auxFd)
fork:true
- newPgrp:true "/ false
+ newPgrp:newPgrp
inDirectory:dir.
nullStream notNil ifTrue:[
@@ -3769,6 +3769,28 @@
"Modified: / 15.7.1997 / 16:03:51 / stefan"
"Modified: / 5.6.1998 / 19:03:51 / cg"
"Created: / 12.11.1998 / 14:39:20 / cg"
+!
+
+startProcess:aCommandString inputFrom:anExternalInStream outputTo:anExternalOutStream
+ errorTo:anExternalErrStream auxFrom:anAuxiliaryStream
+ environment:anEvironmentDictionary inDirectory:dir showWindow:ignoredHere
+
+ "start executing the OS command as specified by the argument, aCommandString
+ as a separate process; do not wait for the command to finish.
+ 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.
+ The command gets stdIn, stdOut and stdErr assigned from the arguments;
+ each may be nil.
+ Return the processId if successful, nil otherwise.
+ Use #monitorPid:action: for synchronization and exec status return,
+ or #killProcess: to stop it."
+
+ ^ self
+ startProcess:aCommandString inputFrom:anExternalInStream outputTo:anExternalOutStream
+ errorTo:anExternalErrStream auxFrom:anAuxiliaryStream
+ environment:anEvironmentDictionary inDirectory:dir newPgrp:true showWindow:ignoredHere
! !
!UnixOperatingSystem class methodsFor:'executing OS commands-queries'!