author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Thu, 01 Jul 2010 19:21:34 +0100 | |
branch | jv |
changeset 17772 | 6e0b3c06c364 |
parent 17767 | a4a32df3aa5e |
child 17780 | b6e42c92eba0 |
permissions | -rw-r--r-- |
17751 | 1 |
" |
2 |
COPYRIGHT (c) 1998 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
"{ Package: 'stx:libbasic' }" |
|
13 |
||
3925 | 14 |
Object subclass:#Win32Process |
15 |
instanceVariableNames:'command environment directory inStream outStream errorStream pid |
|
16 |
exitStatus finishSema' |
|
17 |
classVariableNames:'' |
|
18 |
poolDictionaries:'' |
|
19 |
category:'OS-Windows' |
|
20 |
! |
|
21 |
||
17751 | 22 |
!Win32Process class methodsFor:'documentation'! |
23 |
||
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1998 by eXept Software AG |
|
27 |
All Rights Reserved |
|
28 |
||
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! ! |
|
3925 | 37 |
|
38 |
!Win32Process methodsFor:'accessing'! |
|
39 |
||
40 |
command |
|
41 |
"return the value of the instance variable 'command' (automatically generated)" |
|
42 |
||
43 |
^ command |
|
44 |
||
45 |
"Created: / 10.11.1998 / 21:27:07 / cg" |
|
46 |
! |
|
47 |
||
48 |
command:something |
|
49 |
"set the value of the instance variable 'command' (automatically generated)" |
|
50 |
||
51 |
command := something. |
|
52 |
||
53 |
"Created: / 10.11.1998 / 21:27:07 / cg" |
|
54 |
! |
|
55 |
||
56 |
directory |
|
57 |
"return the value of the instance variable 'directory' (automatically generated)" |
|
58 |
||
59 |
^ directory |
|
60 |
||
61 |
"Created: / 10.11.1998 / 21:21:52 / cg" |
|
62 |
! |
|
63 |
||
64 |
directory:something |
|
65 |
"set the value of the instance variable 'directory' (automatically generated)" |
|
66 |
||
67 |
directory := something. |
|
68 |
||
69 |
"Created: / 10.11.1998 / 21:21:52 / cg" |
|
70 |
! |
|
71 |
||
72 |
environment |
|
73 |
"return the value of the instance variable 'environment' (automatically generated)" |
|
74 |
||
75 |
^ environment |
|
76 |
||
77 |
"Created: / 10.11.1998 / 21:26:34 / cg" |
|
78 |
! |
|
79 |
||
80 |
environment:something |
|
81 |
"set the value of the instance variable 'environment' (automatically generated)" |
|
82 |
||
83 |
environment := something. |
|
84 |
||
85 |
"Created: / 10.11.1998 / 21:27:07 / cg" |
|
86 |
! |
|
87 |
||
88 |
errorStream |
|
89 |
"return the value of the instance variable 'errorStream' (automatically generated)" |
|
90 |
||
91 |
^ errorStream |
|
92 |
||
93 |
"Created: / 10.11.1998 / 21:26:34 / cg" |
|
94 |
! |
|
95 |
||
96 |
errorStream:something |
|
97 |
"set the value of the instance variable 'errorStream' (automatically generated)" |
|
98 |
||
99 |
errorStream := something. |
|
100 |
||
101 |
"Created: / 10.11.1998 / 21:26:34 / cg" |
|
102 |
! |
|
103 |
||
104 |
exitStatus |
|
105 |
"return the value of the instance variable 'exitStatus' (automatically generated)" |
|
106 |
||
107 |
^ exitStatus |
|
108 |
||
109 |
"Created: / 10.11.1998 / 21:24:55 / cg" |
|
110 |
! |
|
111 |
||
112 |
exitStatus:something |
|
113 |
"set the value of the instance variable 'exitStatus' (automatically generated)" |
|
114 |
||
115 |
exitStatus := something. |
|
116 |
||
117 |
"Created: / 10.11.1998 / 21:24:55 / cg" |
|
118 |
! |
|
119 |
||
120 |
finishSema |
|
121 |
"return the value of the instance variable 'finishSema' (automatically generated)" |
|
122 |
||
123 |
^ finishSema |
|
124 |
||
125 |
"Created: / 10.11.1998 / 21:21:53 / cg" |
|
126 |
! |
|
127 |
||
128 |
finishSema:something |
|
129 |
"set the value of the instance variable 'finishSema' (automatically generated)" |
|
130 |
||
131 |
finishSema := something. |
|
132 |
||
133 |
"Created: / 10.11.1998 / 21:21:53 / cg" |
|
134 |
! |
|
135 |
||
136 |
inStream |
|
137 |
"return the value of the instance variable 'inStream' (automatically generated)" |
|
138 |
||
139 |
^ inStream |
|
140 |
||
141 |
"Created: / 10.11.1998 / 21:26:34 / cg" |
|
142 |
! |
|
143 |
||
144 |
inStream:something |
|
145 |
"set the value of the instance variable 'inStream' (automatically generated)" |
|
146 |
||
147 |
inStream := something. |
|
148 |
||
149 |
"Created: / 10.11.1998 / 21:26:34 / cg" |
|
150 |
! |
|
151 |
||
152 |
outStream |
|
153 |
"return the value of the instance variable 'outStream' (automatically generated)" |
|
154 |
||
155 |
^ outStream |
|
156 |
||
157 |
"Created: / 10.11.1998 / 21:26:34 / cg" |
|
158 |
! |
|
159 |
||
160 |
outStream:something |
|
161 |
"set the value of the instance variable 'outStream' (automatically generated)" |
|
162 |
||
163 |
outStream := something. |
|
164 |
||
165 |
"Created: / 10.11.1998 / 21:26:34 / cg" |
|
166 |
! |
|
167 |
||
168 |
pid |
|
169 |
"return the value of the instance variable 'pid' (automatically generated)" |
|
170 |
||
171 |
^ pid |
|
172 |
||
173 |
"Created: / 10.11.1998 / 21:21:53 / cg" |
|
174 |
! |
|
175 |
||
176 |
pid:something |
|
177 |
"set the value of the instance variable 'pid' (automatically generated)" |
|
178 |
||
179 |
pid := something. |
|
180 |
||
181 |
"Created: / 10.11.1998 / 21:21:53 / cg" |
|
182 |
! ! |
|
183 |
||
184 |
!Win32Process methodsFor:'starting'! |
|
185 |
||
186 |
startProcess |
|
187 |
finishSema := Semaphore new. |
|
188 |
||
189 |
pid := Processor |
|
190 |
monitor:[ |
|
191 |
OperatingSystem |
|
192 |
startProcess:command |
|
193 |
inputFrom:inStream |
|
194 |
outputTo:outStream |
|
195 |
errorTo:errorStream |
|
196 |
inDirectory:directory. |
|
197 |
] |
|
198 |
action:[:status | |
|
199 |
status stillAlive ifFalse:[ |
|
200 |
exitStatus := status. |
|
201 |
OperatingSystem closePid:pid. |
|
202 |
finishSema signal |
|
203 |
]. |
|
204 |
]. |
|
205 |
||
206 |
pid isNil ifTrue:[ |
|
207 |
exitStatus := self osProcessStatusClass processCreationFailure. |
|
208 |
^ false |
|
209 |
]. |
|
210 |
||
211 |
^ true. |
|
212 |
||
213 |
"Created: / 10.11.1998 / 21:23:50 / cg" |
|
214 |
"Modified: / 10.11.1998 / 21:33:16 / cg" |
|
215 |
! ! |
|
216 |
||
217 |
!Win32Process class methodsFor:'documentation'! |
|
218 |
||
219 |
version |
|
17772
6e0b3c06c364
Method reverted to r10532
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17767
diff
changeset
|
220 |
^ '$Id: Win32Process.st 10534 2010-07-01 18:21:34Z vranyj1 $' |
17751 | 221 |
! |
222 |
||
223 |
version_CVS |
|
17772
6e0b3c06c364
Method reverted to r10532
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17767
diff
changeset
|
224 |
^ '§Header: /cvs/stx/stx/libbasic/Win32Process.st,v 1.2 2010/02/01 11:29:35 cg Exp §' |
3925 | 225 |
! ! |
17751 | 226 |
|
17767 | 227 |
|
17772
6e0b3c06c364
Method reverted to r10532
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17767
diff
changeset
|
228 |