AbstractOperatingSystem.st
changeset 24726 6c5eecfc3b9a
parent 24725 3653b4978685
child 24777 a617f175dc1b
equal deleted inserted replaced
24725:3653b4978685 24726:6c5eecfc3b9a
   992      as a separate process; do not wait for the command to finish.
   992      as a separate process; do not wait for the command to finish.
   993      If aCommandString is a String, the commandString is passed to a shell for execution
   993      If aCommandString is a String, the commandString is passed to a shell for execution
   994      - see the description of 'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual).
   994      - see the description of 'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual).
   995      If aCommandString is an Array, the first element is the command to be executed,
   995      If aCommandString is an Array, the first element is the command to be executed,
   996      and the other elements are the arguments to the command. No shell is invoked in this case.
   996      and the other elements are the arguments to the command. No shell is invoked in this case.
   997      The command gets stdIn, stdOut and stdErr assigned from the arguments;
   997      The command gets stdIn, stdOut and stdErr assigned from the arguments; each may be nil.
   998      each may be nil.
   998      If auxInStream is nonNil, it is passed as FD3 for reading;
       
   999      if auxOutStream is nonNil, it is passed as FD4 for writing.
   999      Return the processId if successful, nil otherwise.
  1000      Return the processId if successful, nil otherwise.
  1000      Notice: on Unix, this id is an integer; on Windows, it is a processhandle.
  1001      Notice: on Unix, this id is an integer; on Windows, it is a processhandle.
  1001      Use #monitorPid:action: for synchronization and exec status return,
  1002      Use #monitorPid:action: for synchronization and exec status return,
  1002      or #killProcess: to stop it."
  1003      or #killProcess: to stop it."
  1003 
  1004 
  1192     "Created: / 12.11.1998 / 14:39:20 / cg"
  1193     "Created: / 12.11.1998 / 14:39:20 / cg"
  1193 !
  1194 !
  1194 
  1195 
  1195 startProcess:aCommandString 
  1196 startProcess:aCommandString 
  1196     inputFrom:anExternalInStreamOrNil outputTo:anExternalOutStreamOrNil errorTo:anExternalErrStreamOrNil 
  1197     inputFrom:anExternalInStreamOrNil outputTo:anExternalOutStreamOrNil errorTo:anExternalErrStreamOrNil 
  1197     auxFrom:anAuxiliaryStreamOrNil
  1198     auxFrom:anAuxiliaryInStreamOrNil
  1198     environment:anEvironmentDictionary inDirectory:dir newPgrp:newPgrp showWindow:showWindowBooleanOrNil
  1199     environment:anEvironmentDictionary inDirectory:dir newPgrp:newPgrp showWindow:showWindowBooleanOrNil
  1199 
  1200 
  1200     "start executing the OS command as specified by the argument, aCommandString
  1201     "start executing the OS command as specified by the argument, aCommandString
  1201      as a separate process; do not wait for the command to finish.
  1202      as a separate process; do not wait for the command to finish.
  1202      If aCommandString is a String, the commandString is passed to a shell for execution
  1203      If aCommandString is a String, the commandString is passed to a shell for execution
  1203      - see the description of 'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual).
  1204      - see the description of 'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual).
  1204      If aCommandString is an Array, the first element is the command to be executed,
  1205      If aCommandString is an Array, the first element is the command to be executed,
  1205      and the other elements are the arguments to the command. No shell is invoked in this case.
  1206      and the other elements are the arguments to the command. No shell is invoked in this case.
  1206      The command gets stdIn, stdOut and stdErr assigned from the arguments;
  1207      The command gets stdIn, stdOut and stdErr assigned from the arguments; each may be nil.
  1207      each may be nil.
  1208      If auxInStream is nonNil, it is passed as FD3 for reading;
  1208      Return the processId if successful, nil otherwise.
  1209      Return the processId if successful, nil otherwise.
  1209      Notice: on Unix, this id is an integer; on Windows, it is a processhandle.
  1210      Notice: on Unix, this id is an integer; on Windows, it is a processhandle.
  1210      Use #monitorPid:action: for synchronization and exec status return,
  1211      Use #monitorPid:action: for synchronization and exec status return,
  1211      or #killProcess: to stop it."
  1212      or #killProcess: to stop it."
  1212 
  1213 
  1213     ^ self
  1214     ^ self
  1214         startProcess:aCommandString 
  1215         startProcess:aCommandString 
  1215         inputFrom:anExternalInStreamOrNil outputTo:anExternalOutStreamOrNil errorTo:anExternalErrStreamOrNil 
  1216         inputFrom:anExternalInStreamOrNil outputTo:anExternalOutStreamOrNil errorTo:anExternalErrStreamOrNil 
  1216         auxFrom:anAuxiliaryStreamOrNil aux2To:nil
  1217         auxFrom:anAuxiliaryInStreamOrNil aux2To:nil
  1217         environment:anEvironmentDictionary inDirectory:dir 
  1218         environment:anEvironmentDictionary inDirectory:dir 
  1218         newPgrp:newPgrp 
  1219         newPgrp:newPgrp 
  1219         showWindow:showWindowBooleanOrNil
  1220         showWindow:showWindowBooleanOrNil
  1220 
  1221 
  1221     "blocking at current prio (i.e. only higher prio threads execute):
  1222     "blocking at current prio (i.e. only higher prio threads execute):