3925
|
1 |
Object subclass:#Win32Process
|
|
2 |
instanceVariableNames:'command environment directory inStream outStream errorStream pid
|
|
3 |
exitStatus finishSema'
|
|
4 |
classVariableNames:''
|
|
5 |
poolDictionaries:''
|
|
6 |
category:'OS-Windows'
|
|
7 |
!
|
|
8 |
|
|
9 |
|
|
10 |
!Win32Process methodsFor:'accessing'!
|
|
11 |
|
|
12 |
command
|
|
13 |
"return the value of the instance variable 'command' (automatically generated)"
|
|
14 |
|
|
15 |
^ command
|
|
16 |
|
|
17 |
"Created: / 10.11.1998 / 21:27:07 / cg"
|
|
18 |
!
|
|
19 |
|
|
20 |
command:something
|
|
21 |
"set the value of the instance variable 'command' (automatically generated)"
|
|
22 |
|
|
23 |
command := something.
|
|
24 |
|
|
25 |
"Created: / 10.11.1998 / 21:27:07 / cg"
|
|
26 |
!
|
|
27 |
|
|
28 |
directory
|
|
29 |
"return the value of the instance variable 'directory' (automatically generated)"
|
|
30 |
|
|
31 |
^ directory
|
|
32 |
|
|
33 |
"Created: / 10.11.1998 / 21:21:52 / cg"
|
|
34 |
!
|
|
35 |
|
|
36 |
directory:something
|
|
37 |
"set the value of the instance variable 'directory' (automatically generated)"
|
|
38 |
|
|
39 |
directory := something.
|
|
40 |
|
|
41 |
"Created: / 10.11.1998 / 21:21:52 / cg"
|
|
42 |
!
|
|
43 |
|
|
44 |
environment
|
|
45 |
"return the value of the instance variable 'environment' (automatically generated)"
|
|
46 |
|
|
47 |
^ environment
|
|
48 |
|
|
49 |
"Created: / 10.11.1998 / 21:26:34 / cg"
|
|
50 |
!
|
|
51 |
|
|
52 |
environment:something
|
|
53 |
"set the value of the instance variable 'environment' (automatically generated)"
|
|
54 |
|
|
55 |
environment := something.
|
|
56 |
|
|
57 |
"Created: / 10.11.1998 / 21:27:07 / cg"
|
|
58 |
!
|
|
59 |
|
|
60 |
errorStream
|
|
61 |
"return the value of the instance variable 'errorStream' (automatically generated)"
|
|
62 |
|
|
63 |
^ errorStream
|
|
64 |
|
|
65 |
"Created: / 10.11.1998 / 21:26:34 / cg"
|
|
66 |
!
|
|
67 |
|
|
68 |
errorStream:something
|
|
69 |
"set the value of the instance variable 'errorStream' (automatically generated)"
|
|
70 |
|
|
71 |
errorStream := something.
|
|
72 |
|
|
73 |
"Created: / 10.11.1998 / 21:26:34 / cg"
|
|
74 |
!
|
|
75 |
|
|
76 |
exitStatus
|
|
77 |
"return the value of the instance variable 'exitStatus' (automatically generated)"
|
|
78 |
|
|
79 |
^ exitStatus
|
|
80 |
|
|
81 |
"Created: / 10.11.1998 / 21:24:55 / cg"
|
|
82 |
!
|
|
83 |
|
|
84 |
exitStatus:something
|
|
85 |
"set the value of the instance variable 'exitStatus' (automatically generated)"
|
|
86 |
|
|
87 |
exitStatus := something.
|
|
88 |
|
|
89 |
"Created: / 10.11.1998 / 21:24:55 / cg"
|
|
90 |
!
|
|
91 |
|
|
92 |
finishSema
|
|
93 |
"return the value of the instance variable 'finishSema' (automatically generated)"
|
|
94 |
|
|
95 |
^ finishSema
|
|
96 |
|
|
97 |
"Created: / 10.11.1998 / 21:21:53 / cg"
|
|
98 |
!
|
|
99 |
|
|
100 |
finishSema:something
|
|
101 |
"set the value of the instance variable 'finishSema' (automatically generated)"
|
|
102 |
|
|
103 |
finishSema := something.
|
|
104 |
|
|
105 |
"Created: / 10.11.1998 / 21:21:53 / cg"
|
|
106 |
!
|
|
107 |
|
|
108 |
inStream
|
|
109 |
"return the value of the instance variable 'inStream' (automatically generated)"
|
|
110 |
|
|
111 |
^ inStream
|
|
112 |
|
|
113 |
"Created: / 10.11.1998 / 21:26:34 / cg"
|
|
114 |
!
|
|
115 |
|
|
116 |
inStream:something
|
|
117 |
"set the value of the instance variable 'inStream' (automatically generated)"
|
|
118 |
|
|
119 |
inStream := something.
|
|
120 |
|
|
121 |
"Created: / 10.11.1998 / 21:26:34 / cg"
|
|
122 |
!
|
|
123 |
|
|
124 |
outStream
|
|
125 |
"return the value of the instance variable 'outStream' (automatically generated)"
|
|
126 |
|
|
127 |
^ outStream
|
|
128 |
|
|
129 |
"Created: / 10.11.1998 / 21:26:34 / cg"
|
|
130 |
!
|
|
131 |
|
|
132 |
outStream:something
|
|
133 |
"set the value of the instance variable 'outStream' (automatically generated)"
|
|
134 |
|
|
135 |
outStream := something.
|
|
136 |
|
|
137 |
"Created: / 10.11.1998 / 21:26:34 / cg"
|
|
138 |
!
|
|
139 |
|
|
140 |
pid
|
|
141 |
"return the value of the instance variable 'pid' (automatically generated)"
|
|
142 |
|
|
143 |
^ pid
|
|
144 |
|
|
145 |
"Created: / 10.11.1998 / 21:21:53 / cg"
|
|
146 |
!
|
|
147 |
|
|
148 |
pid:something
|
|
149 |
"set the value of the instance variable 'pid' (automatically generated)"
|
|
150 |
|
|
151 |
pid := something.
|
|
152 |
|
|
153 |
"Created: / 10.11.1998 / 21:21:53 / cg"
|
|
154 |
! !
|
|
155 |
|
|
156 |
!Win32Process methodsFor:'starting'!
|
|
157 |
|
|
158 |
startProcess
|
|
159 |
finishSema := Semaphore new.
|
|
160 |
|
|
161 |
pid := Processor
|
|
162 |
monitor:[
|
|
163 |
OperatingSystem
|
|
164 |
startProcess:command
|
|
165 |
inputFrom:inStream
|
|
166 |
outputTo:outStream
|
|
167 |
errorTo:errorStream
|
|
168 |
inDirectory:directory.
|
|
169 |
]
|
|
170 |
action:[:status |
|
|
171 |
status stillAlive ifFalse:[
|
|
172 |
exitStatus := status.
|
|
173 |
OperatingSystem closePid:pid.
|
|
174 |
finishSema signal
|
|
175 |
].
|
|
176 |
].
|
|
177 |
|
|
178 |
pid isNil ifTrue:[
|
|
179 |
exitStatus := self osProcessStatusClass processCreationFailure.
|
|
180 |
^ false
|
|
181 |
].
|
|
182 |
|
|
183 |
^ true.
|
|
184 |
|
|
185 |
"Created: / 10.11.1998 / 21:23:50 / cg"
|
|
186 |
"Modified: / 10.11.1998 / 21:33:16 / cg"
|
|
187 |
! !
|
|
188 |
|
|
189 |
!Win32Process class methodsFor:'documentation'!
|
|
190 |
|
|
191 |
version
|
|
192 |
^ '$Header: /cvs/stx/stx/libbasic/Win32Process.st,v 1.1 1998-11-11 15:01:21 cg Exp $'
|
|
193 |
! !
|