#FEATURE by cg
class: Win32OperatingSystem
added: #startProcess:inputFrom:outputTo:errorTo:auxFrom:environment:inDirectory:newPgrp:showWindow:
removed: #startProcess:inputFrom:outputTo:errorTo:auxFrom:environment:inDirectory:showWindow:
--- a/Win32OperatingSystem.st Tue Nov 08 20:17:39 2016 +0100
+++ b/Win32OperatingSystem.st Tue Nov 08 21:28:04 2016 +0100
@@ -903,16 +903,6 @@
"
! !
-!Win32OperatingSystem class methodsFor:'debugging'!
-
-verbose:aBoolean
-%{
-#ifdef PROCESSDEBUGWIN32
- flag_PROCESSDEBUGWIN32 = (aBoolean == true);
-#endif
-%}
-! !
-
!Win32OperatingSystem class methodsFor:'initialization'!
coInitialize
@@ -1723,6 +1713,16 @@
result = 0 ifTrue: [ ^self error ].
! !
+!Win32OperatingSystem class methodsFor:'debugging'!
+
+verbose:aBoolean
+%{
+#ifdef PROCESSDEBUGWIN32
+ flag_PROCESSDEBUGWIN32 = (aBoolean == true);
+#endif
+%}
+! !
+
!Win32OperatingSystem class methodsFor:'directory access'!
linkInfoFor:osPathname fileSize:fileSize fileAttributes:osFileAttributes osCrtTime:osCrtTime osAccTime:osAccTime osModTime:osModTime
@@ -4339,7 +4339,7 @@
startProcess:aCommandString inputFrom:anExternalInStream outputTo:anExternalOutStream
errorTo:anExternalErrStream auxFrom:anAuxiliaryStream
environment:anEvironmentDictionary inDirectory:dir
- showWindow:showWindowBooleanOrNil
+ newPgrp:newPgrp showWindow:showWindowBooleanOrNil
"start executing the OS command as specified by the argument, aCommandString
as a separate process; do not wait for the command to finish.
@@ -4361,32 +4361,32 @@
shellAndArgs := self commandAndArgsForOSCommand:aCommandString.
(in := anExternalInStream) isNil ifTrue:[
- nullStream := Filename nullDevice readWriteStream.
- in := nullStream.
+ nullStream := Filename nullDevice readWriteStream.
+ in := nullStream.
].
(out := anExternalOutStream) isNil ifTrue:[
- nullStream isNil ifTrue:[nullStream := Filename nullDevice writeStream].
- out := nullStream.
+ nullStream isNil ifTrue:[nullStream := Filename nullDevice writeStream].
+ out := nullStream.
].
(err := anExternalErrStream) isNil ifTrue:[
- err := out
+ err := out
].
rslt := self
- exec:(shellAndArgs at:1)
- withArguments:(shellAndArgs at:2)
- environment:anEvironmentDictionary
- fileDescriptors:(Array with:in fileHandle
- with:out fileHandle
- with:err fileHandle
- with:(anAuxiliaryStream notNil ifTrue:[anAuxiliaryStream fileHandle] ifFalse:[nil]))
- fork:true
- newPgrp:true
- inDirectory:dir
- showWindow:(showWindowBooleanOrNil ? (shellAndArgs at:3)).
+ exec:(shellAndArgs at:1)
+ withArguments:(shellAndArgs at:2)
+ environment:anEvironmentDictionary
+ fileDescriptors:(Array with:in fileHandle
+ with:out fileHandle
+ with:err fileHandle
+ with:(anAuxiliaryStream notNil ifTrue:[anAuxiliaryStream fileHandle] ifFalse:[nil]))
+ fork:true
+ newPgrp:true
+ inDirectory:dir
+ showWindow:(showWindowBooleanOrNil ? (shellAndArgs at:3)).
nullStream notNil ifTrue:[
- nullStream close.
+ nullStream close.
].
^ rslt
@@ -4412,7 +4412,7 @@
The following will no longer work. monitorPid has disappeared
pid notNil ifTrue:[
- Processor monitorPid:pid action:[:OSstatus | sema signal ].
+ Processor monitorPid:pid action:[:OSstatus | sema signal ].
].
in close.
out close.
@@ -4427,10 +4427,10 @@
sema := Semaphore new.
Processor
- monitor:[
- pid := OperatingSystem startProcess:'dir > out 2>err'
- ]
- action:[:osStatus | sema signal ].
+ monitor:[
+ pid := OperatingSystem startProcess:'dir > out 2>err'
+ ]
+ action:[:osStatus | sema signal ].
sema wait.
Transcript showCR:'finished'
@@ -4442,10 +4442,10 @@
sema := Semaphore new.
Processor
- monitor:[
- pid := OperatingSystem startProcess:'(echo 1 & stx --eval "Delay waitForSeconds:100" & dir) >out' withCRs
- ]
- action:[:osStatus | sema signal ].
+ monitor:[
+ pid := OperatingSystem startProcess:'(echo 1 & stx --eval "Delay waitForSeconds:100" & dir) >out' withCRs
+ ]
+ action:[:osStatus | sema signal ].
Delay waitForSeconds:5.
OperatingSystem terminateProcessGroup:pid.
@@ -4458,20 +4458,17 @@
sema := Semaphore new.
Processor
- monitor:[
- pid := OperatingSystem startProcess:{ 'C:\Users\cg\work\stx\projects\smalltalk\stx.com' . '--eval' . '"Delay waitForSeconds:100"' }
- ]
- action:[:osStatus | sema signal ].
+ monitor:[
+ pid := OperatingSystem startProcess:{ 'C:\Users\cg\work\stx\projects\smalltalk\stx.com' . '--eval' . '"Delay waitForSeconds:100"' }
+ ]
+ action:[:osStatus | sema signal ].
Delay waitForSeconds:5.
OperatingSystem terminateProcess:pid.
Transcript showCR:'terminated'
END"
- "Modified: / 21-03-1997 / 10:04:35 / dq"
- "Modified: / 15-07-1997 / 16:03:51 / stefan"
- "Created: / 12-11-1998 / 14:39:20 / cg"
- "Modified: / 30-06-2016 / 17:43:46 / cg"
+ "Created: / 08-11-2016 / 21:23:17 / cg"
! !
!Win32OperatingSystem class methodsFor:'file access'!