author | Claus Gittinger <cg@exept.de> |
Thu, 24 Aug 2006 12:43:40 +0200 | |
changeset 9700 | abcbfeb235b6 |
parent 9699 | 9e706dd0ccc8 |
child 9721 | da01ca2c113c |
permissions | -rw-r--r-- |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2 |
COPYRIGHT (c) 1988 by Claus Gittinger |
7711 | 3 |
All Rights Reserved |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5 |
This software is furnished under a license and may be used |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6 |
only in accordance with the terms of that license and with the |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
7 |
inclusion of the above copyright notice. This software may not |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
8 |
be provided or otherwise made available to, or used by, any |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
9 |
other person. No title to or ownership of the software is |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
10 |
hereby transferred. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
11 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
12 |
|
5407 | 13 |
"{ Package: 'stx:libbasic' }" |
14 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
15 |
Object subclass:#AbstractOperatingSystem |
7073
f90c5774e8d6
close all fd's above the onces passed in fileDescriptors array.
ca
parents:
7071
diff
changeset
|
16 |
instanceVariableNames:'' |
f90c5774e8d6
close all fd's above the onces passed in fileDescriptors array.
ca
parents:
7071
diff
changeset
|
17 |
classVariableNames:'ConcreteClass LastErrorNumber LocaleInfo OSSignals PipeFailed |
f90c5774e8d6
close all fd's above the onces passed in fileDescriptors array.
ca
parents:
7071
diff
changeset
|
18 |
ErrorSignal AccessDeniedErrorSignal FileNotFoundErrorSignal |
f90c5774e8d6
close all fd's above the onces passed in fileDescriptors array.
ca
parents:
7071
diff
changeset
|
19 |
InvalidArgumentsSignal UnsupportedOperationSignal Resources' |
f90c5774e8d6
close all fd's above the onces passed in fileDescriptors array.
ca
parents:
7071
diff
changeset
|
20 |
poolDictionaries:'' |
f90c5774e8d6
close all fd's above the onces passed in fileDescriptors array.
ca
parents:
7071
diff
changeset
|
21 |
category:'System-Support' |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
22 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
23 |
|
9476 | 24 |
Object subclass:#PrinterInfo |
25 |
instanceVariableNames:'printerName attributes documentProperties printerInfo2' |
|
26 |
classVariableNames:'' |
|
27 |
poolDictionaries:'' |
|
28 |
privateIn:AbstractOperatingSystem |
|
29 |
! |
|
30 |
||
7514 | 31 |
Object subclass:#TimeInfo |
32 |
instanceVariableNames:'year month day hours minutes seconds utcOffset dst milliseconds |
|
33 |
dayInYear dayInWeek' |
|
34 |
classVariableNames:'' |
|
35 |
poolDictionaries:'' |
|
36 |
privateIn:AbstractOperatingSystem |
|
37 |
! |
|
38 |
||
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
39 |
!AbstractOperatingSystem primitiveDefinitions! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
40 |
%{ |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
41 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
42 |
#include "stxOSDefs.h" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
43 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
44 |
%} |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
45 |
! ! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
46 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
47 |
!AbstractOperatingSystem class methodsFor:'documentation'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
48 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
49 |
copyright |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
50 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
51 |
COPYRIGHT (c) 1988 by Claus Gittinger |
7711 | 52 |
All Rights Reserved |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
53 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
54 |
This software is furnished under a license and may be used |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
55 |
only in accordance with the terms of that license and with the |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
56 |
inclusion of the above copyright notice. This software may not |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
57 |
be provided or otherwise made available to, or used by, any |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
58 |
other person. No title to or ownership of the software is |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
59 |
hereby transferred. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
60 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
61 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
62 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
63 |
documentation |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
64 |
" |
4200 | 65 |
this class realizes services common to the supported operating systems; |
66 |
typically, services which can be implemented based upon more primitive |
|
67 |
functions, or which can be implemented in a portable way (but probably |
|
68 |
less performant) are implemented here. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
69 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
70 |
[Class variables:] |
7711 | 71 |
ConcreteClass <Class> the real OS class |
72 |
||
73 |
LocaleInfo <Dictionary> if non nil, that is taken instead of the operating |
|
74 |
systems locale definitions (allows for overwriting |
|
75 |
these, or provide a compatible info on systems which do |
|
76 |
not support locales) |
|
77 |
||
78 |
LastErrorNumber <Integer> the last value of errno |
|
79 |
||
80 |
OSSignals <Array> Array of signals to be raised for corresponding |
|
81 |
OperatingSystem signals. |
|
82 |
||
83 |
PipeFailed <Boolean> set if a fork (or popen) has failed; |
|
84 |
ST/X will avoid doing more forks/popens |
|
85 |
if this flag is set, for a slightly |
|
86 |
smoother operation. |
|
87 |
||
88 |
ErrorSignal <Signal> Parentsignal of all OS error signals. |
|
89 |
not directly raised. |
|
90 |
||
91 |
AccessDeniedErrorSignal misc concrete error reporting signals |
|
92 |
FileNotFoundErrorSignal |
|
93 |
UnsupportedOperationSignal |
|
94 |
InvalidArgumentsSignal |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
95 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
96 |
[author:] |
7711 | 97 |
Claus Gittinger |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
98 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
99 |
[see also:] |
7711 | 100 |
OSProcessStatus |
101 |
Filename Date Time |
|
102 |
ExternalStream FileStream PipeStream Socket |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
103 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
104 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
105 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
106 |
examples |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
107 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
108 |
various queries |
7711 | 109 |
[exBegin] |
8669 | 110 |
Transcript |
7711 | 111 |
showCR:'hello ' , (OperatingSystem getLoginName) |
112 |
[exEnd] |
|
113 |
||
114 |
[exBegin] |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
115 |
OperatingSystem isUNIXlike ifTrue:[ |
7711 | 116 |
Transcript showCR:'this is some UNIX-like OS' |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
117 |
] ifFalse:[ |
7711 | 118 |
Transcript showCR:'this OS is not UNIX-like' |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
119 |
] |
7711 | 120 |
[exEnd] |
121 |
||
122 |
[exBegin] |
|
8669 | 123 |
Transcript |
7711 | 124 |
showCR:'this machine is called ' , OperatingSystem getHostName |
125 |
[exEnd] |
|
126 |
||
127 |
[exBegin] |
|
8669 | 128 |
Transcript |
7711 | 129 |
showCR:('this machine is in the ' |
130 |
, OperatingSystem getDomainName |
|
131 |
, ' domain') |
|
132 |
[exEnd] |
|
133 |
||
134 |
[exBegin] |
|
8669 | 135 |
Transcript |
7711 | 136 |
showCR:('this machine''s CPU is a ' |
137 |
, OperatingSystem getCPUType |
|
138 |
) |
|
139 |
[exEnd] |
|
140 |
||
141 |
[exBegin] |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
142 |
Transcript showCR:'executing ls command ...'. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
143 |
OperatingSystem executeCommand:'ls'. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
144 |
Transcript showCR:'... done.'. |
7711 | 145 |
[exEnd] |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
146 |
|
8669 | 147 |
locking a file |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
148 |
(should be executed on two running smalltalks - not in two threads): |
7711 | 149 |
[exBegin] |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
150 |
|f| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
151 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
152 |
f := 'testFile' asFilename readWriteStream. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
153 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
154 |
10 timesRepeat:[ |
7711 | 155 |
'about to lock ...' printCR. |
156 |
[ |
|
8669 | 157 |
OperatingSystem |
7711 | 158 |
lockFD:(f fileDescriptor) |
159 |
shared:false |
|
160 |
blocking:false |
|
161 |
] whileFalse:[ |
|
162 |
'process ' print. OperatingSystem getProcessId print. ' is waiting' printCR. |
|
163 |
Delay waitForSeconds:1 |
|
164 |
]. |
|
165 |
'LOCKED ...' printCR. |
|
166 |
Delay waitForSeconds:10. |
|
167 |
'unlock ...' printCR. |
|
8669 | 168 |
(OperatingSystem |
7711 | 169 |
unlockFD:(f fileDescriptor)) printCR. |
170 |
Delay waitForSeconds:3. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
171 |
] |
7711 | 172 |
[exBegin] |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
173 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
174 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
175 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
176 |
!AbstractOperatingSystem class methodsFor:'initialization'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
177 |
|
6278 | 178 |
initResources |
8715 | 179 |
"/ allow for ResourcePack class to be missing (non-GUI smalltalks) |
180 |
ResourcePack notNil ifTrue:[ |
|
8784 | 181 |
Resources := ResourcePack forPackage:(self package). |
8715 | 182 |
] |
6278 | 183 |
! |
184 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
185 |
initialize |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
186 |
"initialize the class" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
187 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
188 |
self initializeConcreteClass. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
189 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
190 |
ErrorSignal isNil ifTrue:[ |
8669 | 191 |
OSErrorHolder initialize. |
192 |
ErrorSignal := OsError. |
|
193 |
InvalidArgumentsSignal := OsInvalidArgumentsError. |
|
194 |
AccessDeniedErrorSignal := OSErrorHolder noPermissionsSignal. |
|
195 |
FileNotFoundErrorSignal := OSErrorHolder nonexistentSignal. |
|
196 |
UnsupportedOperationSignal := OSErrorHolder unsupportedOperationSignal. |
|
6278 | 197 |
]. |
198 |
Smalltalk addDependent:self. "/ to catch language changes |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
199 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
200 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
201 |
initializeConcreteClass |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
202 |
|osType cls| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
203 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
204 |
osType := self getSystemType. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
205 |
osType = 'win32' ifTrue:[ |
7711 | 206 |
cls := Win32OperatingSystem |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
207 |
] ifFalse:[ |
7711 | 208 |
osType = 'os2' ifTrue:[ |
209 |
cls := OS2OperatingSystem |
|
210 |
] ifFalse:[ |
|
211 |
osType = 'macos' ifTrue:[ |
|
212 |
cls := MacOperatingSystem |
|
213 |
] ifFalse:[ |
|
214 |
((osType = 'VMS') or:[osType = 'openVMS']) ifTrue:[ |
|
215 |
cls := OpenVMSOperatingSystem |
|
216 |
] ifFalse:[ |
|
217 |
cls := UnixOperatingSystem |
|
218 |
] |
|
219 |
] |
|
220 |
] |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
221 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
222 |
OperatingSystem := ConcreteClass := cls. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
223 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
224 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
225 |
!AbstractOperatingSystem class methodsFor:'OS signal constants'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
226 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
227 |
sigABRT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
228 |
"return the signal number for SIGABRT - 0 if not supported by OS |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
229 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
230 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
231 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
232 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
233 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
234 |
sigALRM |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
235 |
"return the signal number for SIGALRM - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
236 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
237 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
238 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
239 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
240 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
241 |
sigBREAK |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
242 |
"return the signal number for SIGBREAK - 0 if not supported. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
243 |
This is an MSDOS specific signal" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
244 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
245 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
246 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
247 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
248 |
sigBUS |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
249 |
"return the signal number for SIGBUS - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
250 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
251 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
252 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
253 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
254 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
255 |
sigCHLD |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
256 |
"return the signal number for SIGCHLD - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
257 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
258 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
259 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
260 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
261 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
262 |
sigCONT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
263 |
"return the signal number for SIGCONT - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
264 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
265 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
266 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
267 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
268 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
269 |
sigDANGER |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
270 |
"return the signal number for SIGDANGER - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
271 |
(seems to be an AIX special)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
272 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
273 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
274 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
275 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
276 |
sigEMT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
277 |
"return the signal number for SIGEMT - 0 if not supported by OS |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
278 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
279 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
280 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
281 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
282 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
283 |
sigFP |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
284 |
"return the signal number for SIGFP - 0 if not supported by OS |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
285 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
286 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
287 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
288 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
289 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
290 |
sigGRANT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
291 |
"return the signal number for SIGGRANT - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
292 |
(seems to be an AIX special)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
293 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
294 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
295 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
296 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
297 |
sigHUP |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
298 |
"return the signal number for SIGHUP |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
299 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
300 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
301 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
302 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
303 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
304 |
sigILL |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
305 |
"return the signal number for SIGILL - 0 if not supported by OS |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
306 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
307 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
308 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
309 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
310 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
311 |
sigINT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
312 |
"return the signal number for SIGINT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
313 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
314 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
315 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
316 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
317 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
318 |
sigIO |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
319 |
"return the signal number for SIGIO - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
320 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
321 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
322 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
323 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
324 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
325 |
sigIOT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
326 |
"return the signal number for SIGIOT - 0 if not supported by OS |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
327 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
328 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
329 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
330 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
331 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
332 |
sigKILL |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
333 |
"return the signal number for SIGKILL |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
334 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
335 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
336 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
337 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
338 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
339 |
sigLOST |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
340 |
"return the signal number for SIGLOST - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
341 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
342 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
343 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
344 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
345 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
346 |
sigMIGRATE |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
347 |
"return the signal number for SIGMIGRATE - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
348 |
(seems to be an AIX special)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
349 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
350 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
351 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
352 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
353 |
sigMSG |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
354 |
"return the signal number for SIGMSG - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
355 |
(seems to be an AIX special)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
356 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
357 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
358 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
359 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
360 |
sigPIPE |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
361 |
"return the signal number for SIGPIPE - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
362 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
363 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
364 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
365 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
366 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
367 |
sigPOLL |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
368 |
"return the signal number for SIGPOLL - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
369 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
370 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
371 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
372 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
373 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
374 |
sigPRE |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
375 |
"return the signal number for SIGPRE - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
376 |
(seems to be an AIX special)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
377 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
378 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
379 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
380 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
381 |
sigPROF |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
382 |
"return the signal number for SIGPROF - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
383 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
384 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
385 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
386 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
387 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
388 |
sigPWR |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
389 |
"return the signal number for SIGPWR - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
390 |
(not available on all systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
391 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
392 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
393 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
394 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
395 |
sigQUIT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
396 |
"return the signal number for SIGQUIT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
397 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
398 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
399 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
400 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
401 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
402 |
sigRETRACT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
403 |
"return the signal number for SIGRETRACT - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
404 |
(seems to be an AIX special)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
405 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
406 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
407 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
408 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
409 |
sigSAK |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
410 |
"return the signal number for SIGSAK - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
411 |
(seems to be an AIX special)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
412 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
413 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
414 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
415 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
416 |
sigSEGV |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
417 |
"return the signal number for SIGSEGV - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
418 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
419 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
420 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
421 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
422 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
423 |
sigSOUND |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
424 |
"return the signal number for SIGSOUND - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
425 |
(seems to be an AIX special)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
426 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
427 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
428 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
429 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
430 |
sigSTOP |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
431 |
"return the signal number for SIGSTOP - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
432 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
433 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
434 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
435 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
436 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
437 |
sigSYS |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
438 |
"return the signal number for SIGSYS - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
439 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
440 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
441 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
442 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
443 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
444 |
sigTERM |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
445 |
"return the signal number for SIGTERM - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
446 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
447 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
448 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
449 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
450 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
451 |
sigTRAP |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
452 |
"return the signal number for SIGTRAP - 0 if not supported by OS |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
453 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
454 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
455 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
456 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
457 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
458 |
sigTSTP |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
459 |
"return the signal number for SIGTSTP - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
460 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
461 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
462 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
463 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
464 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
465 |
sigTTIN |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
466 |
"return the signal number for SIGTTIN - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
467 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
468 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
469 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
470 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
471 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
472 |
sigTTOU |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
473 |
"return the signal number for SIGTTOU - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
474 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
475 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
476 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
477 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
478 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
479 |
sigURG |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
480 |
"return the signal number for SIGURG - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
481 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
482 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
483 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
484 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
485 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
486 |
sigUSR1 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
487 |
"return the signal number for SIGUSR1 - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
488 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
489 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
490 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
491 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
492 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
493 |
sigUSR2 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
494 |
"return the signal number for SIGUSR2 - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
495 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
496 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
497 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
498 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
499 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
500 |
sigVTALRM |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
501 |
"return the signal number for SIGVTALRM - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
502 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
503 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
504 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
505 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
506 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
507 |
sigWINCH |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
508 |
"return the signal number for SIGWINCH - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
509 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
510 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
511 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
512 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
513 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
514 |
sigXCPU |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
515 |
"return the signal number for SIGXCPU - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
516 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
517 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
518 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
519 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
520 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
521 |
sigXFSZ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
522 |
"return the signal number for SIGXFSZ - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
523 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
524 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
525 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
526 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
527 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
528 |
!AbstractOperatingSystem class methodsFor:'Signal constants'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
529 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
530 |
accessDeniedErrorSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
531 |
"return the signal raised when a (file-) access is denied." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
532 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
533 |
^ AccessDeniedErrorSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
534 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
535 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
536 |
errorSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
537 |
"return the parent signal of all OS signals." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
538 |
|
8497 | 539 |
^ OsError |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
540 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
541 |
"Modified: 22.4.1996 / 13:11:31 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
542 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
543 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
544 |
fileNotFoundErrorSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
545 |
"return the signal raised when a file was not found." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
546 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
547 |
^ FileNotFoundErrorSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
548 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
549 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
550 |
invalidArgumentsSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
551 |
"return the signal which is raised for invalid arguments. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
552 |
Currently, this is never raised." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
553 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
554 |
^ InvalidArgumentsSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
555 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
556 |
"Created: 13.9.1997 / 10:46:47 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
557 |
"Modified: 13.9.1997 / 10:47:03 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
558 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
559 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
560 |
unsupportedOperationSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
561 |
"return the signal which is raised when an operation |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
562 |
is attempted, which is not supported by the OS. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
563 |
(For example, creating a link on VMS or MSDOS)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
564 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
565 |
^ UnsupportedOperationSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
566 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
567 |
|
6278 | 568 |
!AbstractOperatingSystem class methodsFor:'change & update'! |
569 |
||
570 |
update:something with:aParameter from:changedObject |
|
7497
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7492
diff
changeset
|
571 |
"Smalltalk notifies us about changes" |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7492
diff
changeset
|
572 |
|
6278 | 573 |
((something == #Language) or:[something == #LanguageTerritory]) ifTrue:[ |
7711 | 574 |
self initResources |
6278 | 575 |
] |
576 |
! ! |
|
577 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
578 |
!AbstractOperatingSystem class methodsFor:'error messages'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
579 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
580 |
clearLastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
581 |
"return the last errors number. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
582 |
See also: #lastErrorSymbol and #lastErrorString. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
583 |
Notice: having a single error number is a bad idea in a multithreaded |
7711 | 584 |
environment - this interface will change." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
585 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
586 |
LastErrorNumber := nil. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
587 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
588 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
589 |
AbstractOperatingSystem clearLastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
590 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
591 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
592 |
"Created: 12.4.1996 / 09:28:58 / stefan" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
593 |
"Modified: 12.4.1996 / 09:38:51 / stefan" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
594 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
595 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
596 |
currentErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
597 |
"returns the OS's last error nr (i.e. the value of errno). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
598 |
Notice, that the value of this flag is only valid immediately |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
599 |
after the error occurred - it gets updated with every other |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
600 |
request to the OS. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
601 |
Use lastErrorNumber - currentErrorNumber is invalidated by |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
602 |
many, many internal calls." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
603 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
604 |
^ self lastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
605 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
606 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
607 |
OperatingSystem currentErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
608 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
609 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
610 |
|
6284 | 611 |
errorHolderForNumber:anInteger |
612 |
||
613 |
^ self subclassResponsibility |
|
614 |
! |
|
615 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
616 |
errorNumberFor:aSymbol |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
617 |
"given a symbolic error, return the numeric; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
618 |
(i.e. errorNumberFor:#EBADF returns EBADF's value). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
619 |
Use this, since error numbers are really not standard across unix systems." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
620 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
621 |
^ -1 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
622 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
623 |
|
6278 | 624 |
errorStringForSymbol:errorSymbol |
625 |
"return an errorMessage for an errorSymbol |
|
626 |
(as kept in an osErrorHolder)." |
|
627 |
||
628 |
Resources isNil ifTrue:[ |
|
8669 | 629 |
self initResources. |
630 |
Resources isNil ifTrue:[ |
|
631 |
^ errorSymbol |
|
632 |
] |
|
6278 | 633 |
]. |
634 |
^ Resources at:errorSymbol ifAbsent:errorSymbol |
|
635 |
||
636 |
" |
|
8669 | 637 |
OperatingSystem errorStringForSymbol:#EPERM |
6278 | 638 |
OperatingSystem errorStringForSymbol:(OperatingSystem errorSymbolForNumber:4) |
639 |
" |
|
640 |
! |
|
641 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
642 |
errorSymbolAndTextForNumber:errNr |
6284 | 643 |
"do not use - temporary for backward compatibility. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
644 |
The returned message is in english (as found in /usr/include/errno.h) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
645 |
and should be replaced by a resource lookup before being presented to the user." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
646 |
|
6284 | 647 |
|holder errSym| |
648 |
||
649 |
holder := self errorHolderForNumber:errNr. |
|
650 |
errSym := holder errorSymbol. |
|
8669 | 651 |
^ Array |
652 |
with:errSym |
|
7711 | 653 |
with:(self errorStringForSymbol:errSym) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
654 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
655 |
" |
8669 | 656 |
OperatingSystem errorSymbolAndTextForNumber:(OperatingSystem errorNumberFor:#EPERM) |
657 |
OperatingSystem errorSymbolAndTextForNumber:(OperatingSystem errorNumberFor:#EIO) |
|
6287 | 658 |
OperatingSystem errorSymbolAndTextForNumber:(OperatingSystem errorNumberFor:#ENXIO) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
659 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
660 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
661 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
662 |
errorSymbolForNumber:errNr |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
663 |
"return a symbol for a unix errorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
664 |
(as returned by a system call)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
665 |
|
6284 | 666 |
^ (self errorHolderForNumber:errNr) errorSymbol |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
667 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
668 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
669 |
OperatingSystem errorSymbolForNumber:4 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
670 |
OperatingSystem errorSymbolForNumber:2 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
671 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
672 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
673 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
674 |
errorTextForNumber:errNr |
8669 | 675 |
"return a message string from a unix errorNumber |
676 |
(as returned by a system call). |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
677 |
The returned message is in english (as found in /usr/include/errno.h) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
678 |
and should be replaced by a resource lookup before being presented to the user." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
679 |
|
6284 | 680 |
^ (self errorHolderForNumber:errNr) errorString |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
681 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
682 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
683 |
OperatingSystem errorTextForNumber:4 |
8669 | 684 |
OperatingSystem errorTextForNumber:(OperatingSystem errorNumberFor:#EPERM) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
685 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
686 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
687 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
688 |
lastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
689 |
"return the last errors number. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
690 |
See also: #lastErrorSymbol and #lastErrorString. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
691 |
Notice: having a single error number is a bad idea in a multithreaded |
7711 | 692 |
environment - this interface will change." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
693 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
694 |
^ LastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
695 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
696 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
697 |
OperatingSystem lastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
698 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
699 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
700 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
701 |
lastErrorString |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
702 |
"return a message string describing the last error. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
703 |
See also: #lastErrorNumber and #lastErrorSymbol. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
704 |
Notice: having a single error number is a bad idea in a multithreaded |
7711 | 705 |
environment - this interface will change." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
706 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
707 |
LastErrorNumber isNil ifTrue:[^ nil]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
708 |
^ self errorTextForNumber:LastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
709 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
710 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
711 |
OperatingSystem lastErrorString |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
712 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
713 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
714 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
715 |
lastErrorSymbol |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
716 |
"return a symbol (such as #EBADF or #EACCESS) describing the last error. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
717 |
See also: #lastErrorNumber and #lastErrorString. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
718 |
Notice: having a single error number is a bad idea in a multithreaded |
7711 | 719 |
environment - this interface will change." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
720 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
721 |
LastErrorNumber isNil ifTrue:[^ nil]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
722 |
^ self errorSymbolForNumber:LastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
723 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
724 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
725 |
OperatingSystem lastErrorSymbol |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
726 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
727 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
728 |
|
7656 | 729 |
!AbstractOperatingSystem class methodsFor:'executing OS commands-implementation'! |
730 |
||
731 |
exec:aCommandPath withArguments:argArray environment:env fileDescriptors:fds fork:doFork newPgrp:newGrp inDirectory:aDirectory |
|
732 |
"execute an OS command" |
|
733 |
||
734 |
^ self subclassResponsibility |
|
735 |
||
736 |
"Created: / 12.11.1998 / 14:46:15 / cg" |
|
737 |
! |
|
738 |
||
739 |
fork |
|
740 |
"fork a new (HEAVY-weight) unix process. |
|
741 |
Not supported with MSDOS & VMS systems. |
|
742 |
Dont confuse this with Block>>fork, which creates |
|
743 |
lightweight smalltalk processes. This method will return |
|
744 |
0 to the child process, and a non-zero number (which is the childs |
|
745 |
unix-process-id) to the parent (original) process. |
|
746 |
||
747 |
In normal situations, you dont need to use this low level entry; see |
|
748 |
#startProcess: and #executCommand: for higher level interfaces." |
|
749 |
||
750 |
"/ |
|
751 |
"/ not supported by OS |
|
752 |
"/ |
|
753 |
||
754 |
^ UnsupportedOperationSignal raise |
|
755 |
! |
|
7637 | 756 |
|
8669 | 757 |
startProcess:aCommandString inputFrom:anExternalInStream outputTo:anExternalOutStream |
7637 | 758 |
errorTo:anExternalErrStream auxFrom:anExternalAuxStreamOrNil environment:environment inDirectory:dir |
759 |
"start executing the OS command as specified by the argument, aCommandString |
|
760 |
as a separate process; do not wait for the command to finish. |
|
761 |
The commandString is passed to a shell for execution - see the description of |
|
762 |
'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
|
763 |
The command gets stdIn, stdOut and stdErr assigned from the arguments; |
|
764 |
each may be nil. |
|
765 |
Return the processId if successful, nil otherwise. |
|
766 |
Use #monitorPid:action: for synchronization and exec status return, |
|
767 |
or #killProcess: to stop it." |
|
768 |
||
769 |
"raise an error: must be redefined in concrete subclass(es)" |
|
770 |
||
771 |
^ self subclassResponsibility |
|
7656 | 772 |
! ! |
773 |
||
774 |
!AbstractOperatingSystem class methodsFor:'executing OS commands-private'! |
|
775 |
||
776 |
shuffleAllFrom:anInStream to:anOutStream lineWise:lineWise lockWith:aLock |
|
777 |
||
778 |
lineWise ifFalse:[ |
|
7711 | 779 |
^ anInStream copyToEndInto:anOutStream. |
7656 | 780 |
]. |
781 |
[anInStream atEnd] whileFalse:[ |
|
7711 | 782 |
aLock critical:[ |
8669 | 783 |
self |
7711 | 784 |
shuffleFrom:anInStream |
785 |
to:anOutStream |
|
786 |
lineWise:lineWise |
|
787 |
] |
|
7656 | 788 |
] |
789 |
! |
|
790 |
||
791 |
shuffleFrom:anInStream to:anOutStream lineWise:lineWise |
|
792 |
"copy data from anInStream to anOutStream. |
|
793 |
Caller makes sure, than anInStream does not block. |
|
794 |
anOutstream should have been set to non-blocking-mode" |
|
795 |
||
796 |
lineWise ifTrue:[ |
|
8669 | 797 |
|data| |
798 |
||
799 |
data := anInStream nextLine. |
|
800 |
data notNil ifTrue:[ |
|
801 |
anOutStream nextPutLine:data |
|
802 |
] . |
|
803 |
] ifFalse:[ |
|
804 |
anInStream copyToEndInto:anOutStream. |
|
7656 | 805 |
]. |
806 |
! |
|
807 |
||
8669 | 808 |
shuffleRestFrom:anInStream to:anOutStream lineWise:lineWise |
7656 | 809 |
[anInStream atEnd] whileFalse:[ |
8669 | 810 |
self |
7711 | 811 |
shuffleFrom:anInStream |
812 |
to:anOutStream |
|
813 |
lineWise:lineWise. |
|
7656 | 814 |
]. |
815 |
! |
|
816 |
||
817 |
startProcess:aCommandString |
|
818 |
"start executing the OS command as specified by the argument, aCommandString |
|
819 |
as a separate process; do not wait for the command to finish. |
|
820 |
The commandString is passed to a shell for execution - see the description of |
|
821 |
'sh -c' in your UNIX manual. |
|
822 |
Return the processId if successful, nil otherwise. |
|
823 |
Use #waitForProcess: for synchronization and exec status return, |
|
824 |
or #killProcess: to stop it." |
|
825 |
||
826 |
^ self |
|
8669 | 827 |
startProcess:aCommandString |
828 |
inputFrom:nil |
|
829 |
outputTo:nil |
|
830 |
errorTo:nil |
|
831 |
auxFrom:nil |
|
7711 | 832 |
inDirectory:nil |
7656 | 833 |
|
834 |
" |
|
835 |
|pid| |
|
836 |
||
837 |
pid := OperatingSystem startProcess:'sleep 2; echo 1; sleep 2; echo 2'. |
|
838 |
(Delay forSeconds:3) wait. |
|
839 |
OperatingSystem killProcess:pid. |
|
840 |
" |
|
841 |
" |
|
842 |
|pid| |
|
843 |
||
844 |
pid := OperatingSystem startProcess:'dir/l'. |
|
845 |
(Delay forSeconds:1) wait. |
|
846 |
OperatingSystem killProcess:pid. |
|
847 |
" |
|
848 |
" |
|
849 |
|pid| |
|
850 |
||
8669 | 851 |
pid := OperatingSystem |
7711 | 852 |
startProcess:'dir/l' |
853 |
inputFrom:nil |
|
854 |
outputTo:Stdout |
|
855 |
errorTo:nil |
|
856 |
inDirectory:nil. |
|
7656 | 857 |
(Delay forSeconds:2) wait. |
858 |
OperatingSystem killProcess:pid. |
|
859 |
" |
|
860 |
||
861 |
"Modified: / 21.3.1997 / 10:04:35 / dq" |
|
862 |
"Modified: / 10.11.1998 / 21:03:50 / cg" |
|
863 |
! |
|
864 |
||
865 |
startProcess:aCommandString inDirectory:aDirectory |
|
866 |
"start executing the OS command as specified by the argument, aCommandString |
|
867 |
as a separate process; do not wait for the command to finish. |
|
868 |
The commandString is passed to a shell for execution - see the description of |
|
869 |
'sh -c' in your UNIX manual. |
|
870 |
Return the processId if successful, nil otherwise. |
|
871 |
Use #waitForProcess: for synchronization and exec status return, |
|
872 |
or #killProcess: to stop it." |
|
873 |
||
874 |
^ self |
|
8669 | 875 |
startProcess:aCommandString |
876 |
inputFrom:nil |
|
877 |
outputTo:nil |
|
878 |
errorTo:nil |
|
879 |
auxFrom:nil |
|
7711 | 880 |
inDirectory:aDirectory |
7656 | 881 |
" |
882 |
|pid| |
|
883 |
||
884 |
pid := OperatingSystem startProcess:'sleep 2; echo 1; sleep 2; echo 2'. |
|
885 |
(Delay forSeconds:3) wait. |
|
886 |
OperatingSystem killProcess:pid. |
|
887 |
" |
|
888 |
||
889 |
"Modified: / 21.3.1997 / 10:04:35 / dq" |
|
890 |
"Modified: / 28.1.1998 / 14:13:33 / md" |
|
891 |
"Modified: / 10.11.1998 / 20:59:33 / cg" |
|
892 |
! |
|
893 |
||
894 |
startProcess:aCommandString inputFrom:anExternalInStream outputTo:anExternalOutStream errorTo:anExternalErrStream |
|
895 |
"start executing the OS command as specified by the argument, aCommandString |
|
896 |
as a separate process; do not wait for the command to finish. |
|
897 |
The commandString is passed to a shell for execution - see the description of |
|
898 |
'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
|
899 |
The command gets stdIn, stdOut and stdErr assigned from the arguments; |
|
900 |
each may be nil. |
|
901 |
Return the processId if successful, nil otherwise. |
|
902 |
Use #monitorPid:action: for synchronization and exec status return, |
|
903 |
or #killProcess: to stop it." |
|
904 |
||
8669 | 905 |
^ self |
906 |
startProcess:aCommandString |
|
907 |
inputFrom:anExternalInStream |
|
908 |
outputTo:anExternalOutStream |
|
909 |
errorTo:anExternalErrStream |
|
910 |
auxFrom:nil |
|
7711 | 911 |
inDirectory:nil |
7656 | 912 |
|
913 |
"Modified: / 10.11.1998 / 20:59:05 / cg" |
|
914 |
! |
|
915 |
||
8587 | 916 |
startProcess:aCommandString inputFrom:anExternalInStream outputTo:anExternalOutStream |
917 |
errorTo:anExternalErrStream auxFrom:anAuxiliaryStream inDirectory:dir |
|
918 |
||
8669 | 919 |
^ self |
920 |
startProcess:aCommandString |
|
921 |
inputFrom:anExternalInStream |
|
922 |
outputTo:anExternalOutStream |
|
923 |
errorTo:anExternalErrStream |
|
924 |
auxFrom:anAuxiliaryStream |
|
925 |
environment:nil |
|
8587 | 926 |
inDirectory:dir |
927 |
! |
|
928 |
||
7656 | 929 |
startProcess:aCommandString inputFrom:anExternalInStream outputTo:anExternalOutStream errorTo:anExternalErrStream inDirectory:dir |
930 |
"start executing the OS command as specified by the argument, aCommandString |
|
931 |
as a separate process; do not wait for the command to finish. |
|
932 |
The commandString is passed to a shell for execution - see the description of |
|
933 |
'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
|
934 |
The command gets stdIn, stdOut and stdErr assigned from the arguments; |
|
935 |
each may be nil. |
|
936 |
Return the processId if successful, nil otherwise. |
|
937 |
Use #monitorPid:action: for synchronization and exec status return, |
|
938 |
or #killProcess: to stop it." |
|
939 |
||
940 |
^ self |
|
8669 | 941 |
startProcess:aCommandString |
942 |
inputFrom:anExternalInStream |
|
943 |
outputTo:anExternalOutStream |
|
944 |
errorTo:anExternalErrStream |
|
945 |
auxFrom:nil |
|
7711 | 946 |
inDirectory:dir |
7637 | 947 |
! ! |
948 |
||
8587 | 949 |
!AbstractOperatingSystem class methodsFor:'executing OS commands-public'! |
7656 | 950 |
|
951 |
executeCommand:aCommandString |
|
952 |
"execute the unix command specified by the argument, aCommandString. |
|
953 |
The commandString is passed to a shell for execution - see the description of |
|
954 |
'sh -c' in your UNIX manual. |
|
955 |
Return true if successful, false otherwise." |
|
956 |
||
957 |
^ self |
|
8669 | 958 |
executeCommand:aCommandString |
959 |
inputFrom:nil |
|
960 |
outputTo:nil |
|
961 |
errorTo:nil |
|
7711 | 962 |
auxFrom:nil |
963 |
inDirectory:nil |
|
964 |
lineWise:false |
|
965 |
onError:[:status| false] |
|
7656 | 966 |
|
967 |
"unix: |
|
968 |
||
8669 | 969 |
OperatingSystem executeCommand:'sleep 30'. |
970 |
OperatingSystem executeCommand:'pwd'. |
|
971 |
OperatingSystem executeCommand:'ls -l'. |
|
972 |
OperatingSystem executeCommand:'invalidCommand'. |
|
973 |
OperatingSystem executeCommand:'rm /tmp/foofoofoofoo'. |
|
7656 | 974 |
" |
975 |
||
976 |
"msdos: |
|
977 |
||
8669 | 978 |
OperatingSystem executeCommand:'dir' |
7656 | 979 |
OperatingSystem executeCommand:'dir /w' |
980 |
" |
|
981 |
||
982 |
"vms: |
|
983 |
||
984 |
OperatingSystem executeCommand:'dir' |
|
985 |
OperatingSystem executeCommand:'purge' |
|
986 |
OperatingSystem executeCommand:'cc foo.c' |
|
987 |
" |
|
988 |
||
989 |
"Modified: / 7.1.1997 / 19:29:55 / stefan" |
|
990 |
"Modified: / 10.11.1998 / 20:55:37 / cg" |
|
991 |
! |
|
992 |
||
993 |
executeCommand:aCommandString errorTo:errorStream |
|
994 |
"execute the unix command specified by the argument, aCommandString. |
|
995 |
The commandString is passed to a shell for execution - see the description of |
|
996 |
'sh -c' in your UNIX manual. |
|
997 |
Return true if successful, false otherwise." |
|
998 |
||
999 |
^ self |
|
8669 | 1000 |
executeCommand:aCommandString |
1001 |
inputFrom:nil |
|
1002 |
outputTo:nil |
|
1003 |
errorTo:errorStream |
|
7711 | 1004 |
auxFrom:nil |
1005 |
inDirectory:nil |
|
1006 |
lineWise:false |
|
1007 |
onError:[:status| false] |
|
7656 | 1008 |
|
1009 |
"unix: |
|
1010 |
||
8669 | 1011 |
OperatingSystem executeCommand:'ls -l' errorTo:Transcript. |
1012 |
OperatingSystem executeCommand:'invalidCommand' errorTo:Transcript. |
|
1013 |
OperatingSystem executeCommand:'rm /tmp/foofoofoofoo' errorTo:Transcript. |
|
7656 | 1014 |
" |
1015 |
! |
|
1016 |
||
1017 |
executeCommand:aCommandString inDirectory:aDirectory |
|
1018 |
"execute the unix command specified by the argument, aCommandString. |
|
1019 |
The commandString is passed to a shell for execution - see the description of |
|
1020 |
'sh -c' in your UNIX manual. |
|
1021 |
Return true if successful, false otherwise." |
|
1022 |
||
1023 |
^ self |
|
8669 | 1024 |
executeCommand:aCommandString |
1025 |
inputFrom:nil |
|
1026 |
outputTo:nil |
|
1027 |
errorTo:nil |
|
7711 | 1028 |
auxFrom:nil |
1029 |
inDirectory:aDirectory |
|
1030 |
lineWise:false |
|
1031 |
onError:[:exitStatus| false] |
|
7656 | 1032 |
|
1033 |
"Modified: / 10.11.1998 / 20:54:37 / cg" |
|
1034 |
! |
|
1035 |
||
8669 | 1036 |
executeCommand:aCommandString inDirectory:aDirectory onError:aBlock |
7656 | 1037 |
"execute the unix command specified by the argument, aCommandString. |
1038 |
The commandString is passed to a shell for execution - see the description of |
|
1039 |
'sh -c' in your UNIX manual. |
|
1040 |
Return true if successful, the value from aBlock if not. |
|
1041 |
If not successfull, aBlock is called with an OsProcessStatus |
|
1042 |
(containing the exit status) as argument." |
|
1043 |
||
1044 |
^ self |
|
8669 | 1045 |
executeCommand:aCommandString |
1046 |
inputFrom:nil |
|
1047 |
outputTo:nil |
|
1048 |
errorTo:nil |
|
7711 | 1049 |
auxFrom:nil |
1050 |
inDirectory:aDirectory |
|
1051 |
lineWise:false |
|
1052 |
onError:aBlock |
|
7656 | 1053 |
|
1054 |
"Modified: / 10.11.1998 / 20:54:37 / cg" |
|
1055 |
! |
|
1056 |
||
8669 | 1057 |
executeCommand:aCommandString inputFrom:anInStream outputTo:anOutStream |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1058 |
errorTo:anErrStream auxFrom:anAuxStream environment:environmentDictionary |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1059 |
inDirectory:dirOrNil lineWise:lineWise onError:aBlock |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1060 |
|
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1061 |
"execute the unix command specified by the argument, aCommandString. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1062 |
The commandString is passed to a shell for execution - see the description of |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1063 |
'sh -c' in your UNIX manual. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1064 |
Return true if successful, or the value of aBlock if not. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1065 |
If not successfull, aBlock is called with an OsProcessStatus |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1066 |
(containing the exit status) as argument. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1067 |
The given in, out and err streams may be arbitrary (Smalltalk-) streams; |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1068 |
if any is not an external stream (which is required by the command), |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1069 |
extra pipes and shuffler processes are created, which stuff the data into |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1070 |
those internal stream(s). |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1071 |
Nil stream args will execute the command connected to ST/X's standard input, output or |
7488
5afbbabd4ae4
More fixes for executeCommand...
Stefan Vogel <sv@exept.de>
parents:
7484
diff
changeset
|
1072 |
error resp. - i.e. usually, i/o will be from/to the terminal. |
5afbbabd4ae4
More fixes for executeCommand...
Stefan Vogel <sv@exept.de>
parents:
7484
diff
changeset
|
1073 |
|
8669 | 1074 |
Set lineWise to true, if both error and output is sent to the same stream |
7497
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7492
diff
changeset
|
1075 |
and you don't want lines to be mangled. Set lineWise = false to |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7492
diff
changeset
|
1076 |
avoid vlocking on pipes" |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1077 |
|
8669 | 1078 |
|pid exitStatus sema pIn pOut pErr pAux externalInStream externalOutStream externalErrStream externalAuxStream |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1079 |
shuffledInStream shuffledOutStream shuffledErrStream shuffledAuxStream |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1080 |
inputShufflerProcess outputShufflerProcess errorShufflerProcess auxShufflerProcess stopShufflers |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1081 |
inStreamToClose outStreamToClose errStreamToClose auxStreamToClose terminateLock| |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1082 |
|
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1083 |
terminateLock := Semaphore forMutualExclusion. |
8669 | 1084 |
((externalInStream := anInStream) notNil |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1085 |
and:[externalInStream isExternalStream not]) ifTrue:[ |
7711 | 1086 |
pIn := NonPositionableExternalStream makePipe. |
1087 |
inStreamToClose := externalInStream := pIn at:1. |
|
1088 |
shuffledInStream := pIn at:2. |
|
1089 |
anInStream isBinary ifTrue:[ |
|
1090 |
shuffledInStream binary |
|
1091 |
]. |
|
1092 |
lineWise ifFalse:[ |
|
1093 |
shuffledInStream blocking:false. |
|
1094 |
]. |
|
1095 |
||
1096 |
"/ start a reader process, shuffling data from the given |
|
1097 |
"/ inStream to the pipe (which is connected to the commands input) |
|
8669 | 1098 |
inputShufflerProcess := |
7711 | 1099 |
[ |
1100 |
[ |
|
1101 |
[anInStream atEnd] whileFalse:[ |
|
1102 |
self shuffleFrom:anInStream to:shuffledInStream lineWise:lineWise. |
|
1103 |
shuffledInStream flush |
|
1104 |
] |
|
1105 |
] ensure:[ |
|
1106 |
shuffledInStream close |
|
1107 |
] |
|
1108 |
] forkNamed:'cmd input shuffler'. |
|
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1109 |
]. |
8669 | 1110 |
((externalOutStream := anOutStream) notNil |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1111 |
and:[externalOutStream isExternalStream not]) ifTrue:[ |
7711 | 1112 |
pOut := NonPositionableExternalStream makePipe. |
1113 |
shuffledOutStream := (pOut at:1). |
|
1114 |
anOutStream isBinary ifTrue:[ |
|
1115 |
shuffledOutStream binary |
|
1116 |
]. |
|
1117 |
outStreamToClose := externalOutStream := pOut at:2. |
|
8669 | 1118 |
outputShufflerProcess := |
7711 | 1119 |
[ |
8669 | 1120 |
self shuffleAllFrom:shuffledOutStream to:anOutStream lineWise:lineWise lockWith:terminateLock. |
7711 | 1121 |
] forkNamed:'cmd output shuffler'. |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1122 |
]. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1123 |
(externalErrStream := anErrStream) notNil ifTrue:[ |
7711 | 1124 |
anErrStream == anOutStream ifTrue:[ |
1125 |
externalErrStream := externalOutStream |
|
1126 |
] ifFalse:[ |
|
1127 |
anErrStream isExternalStream ifFalse:[ |
|
1128 |
pErr := NonPositionableExternalStream makePipe. |
|
1129 |
shuffledErrStream := (pErr at:1). |
|
1130 |
anErrStream isBinary ifTrue:[ |
|
1131 |
shuffledErrStream binary |
|
1132 |
]. |
|
1133 |
errStreamToClose := externalErrStream := pErr at:2. |
|
8669 | 1134 |
errorShufflerProcess := |
7711 | 1135 |
[ |
8669 | 1136 |
self shuffleAllFrom:shuffledErrStream to:anErrStream lineWise:lineWise lockWith:terminateLock. |
7711 | 1137 |
] forkNamed:'cmd err-output shuffler'. |
1138 |
] |
|
1139 |
] |
|
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1140 |
]. |
8669 | 1141 |
((externalAuxStream := anAuxStream) notNil |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1142 |
and:[externalAuxStream isExternalStream not]) ifTrue:[ |
7711 | 1143 |
pAux := NonPositionableExternalStream makePipe. |
1144 |
auxStreamToClose := externalAuxStream := pAux at:1. |
|
1145 |
shuffledAuxStream := pAux at:2. |
|
1146 |
shuffledAuxStream blocking:false. |
|
1147 |
anAuxStream isBinary ifTrue:[ |
|
1148 |
shuffledAuxStream binary |
|
1149 |
]. |
|
1150 |
||
1151 |
"/ start a reader process, shuffling data from the given |
|
1152 |
"/ auxStream to the pipe (which is connected to the commands aux) |
|
8669 | 1153 |
auxShufflerProcess := |
7711 | 1154 |
[ |
1155 |
[ |
|
1156 |
[anAuxStream atEnd] whileFalse:[ |
|
1157 |
self shuffleFrom:anAuxStream to:shuffledAuxStream lineWise:false. |
|
1158 |
shuffledAuxStream flush |
|
1159 |
] |
|
1160 |
] ensure:[ |
|
1161 |
shuffledAuxStream close |
|
1162 |
] |
|
1163 |
] forkNamed:'cmd aux shuffler'. |
|
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1164 |
]. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1165 |
|
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1166 |
sema := Semaphore new name:'OS command wait'. |
8669 | 1167 |
pid := Processor |
7711 | 1168 |
monitor:[ |
8669 | 1169 |
self |
7711 | 1170 |
startProcess:aCommandString |
1171 |
inputFrom:externalInStream |
|
1172 |
outputTo:externalOutStream |
|
1173 |
errorTo:externalErrStream |
|
1174 |
auxFrom:externalAuxStream |
|
8669 | 1175 |
environment:environmentDictionary |
7711 | 1176 |
inDirectory:dirOrNil |
1177 |
] |
|
8669 | 1178 |
action:[:status | |
7711 | 1179 |
status stillAlive ifFalse:[ |
1180 |
exitStatus := status. |
|
1181 |
sema signal. |
|
1182 |
self closePid:pid |
|
1183 |
] |
|
1184 |
]. |
|
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1185 |
|
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1186 |
inStreamToClose notNil ifTrue:[ |
7711 | 1187 |
inStreamToClose close |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1188 |
]. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1189 |
errStreamToClose notNil ifTrue:[ |
7711 | 1190 |
errStreamToClose close |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1191 |
]. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1192 |
outStreamToClose notNil ifTrue:[ |
7711 | 1193 |
outStreamToClose close |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1194 |
]. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1195 |
auxStreamToClose notNil ifTrue:[ |
7711 | 1196 |
auxStreamToClose close |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1197 |
]. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1198 |
|
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1199 |
stopShufflers := [ |
7711 | 1200 |
inputShufflerProcess notNil ifTrue:[ |
1201 |
terminateLock critical:[inputShufflerProcess terminate]. |
|
1202 |
inputShufflerProcess waitUntilTerminated |
|
1203 |
]. |
|
1204 |
auxShufflerProcess notNil ifTrue:[ |
|
1205 |
terminateLock critical:[auxShufflerProcess terminate]. |
|
1206 |
auxShufflerProcess waitUntilTerminated |
|
1207 |
]. |
|
1208 |
outputShufflerProcess notNil ifTrue:[ |
|
1209 |
terminateLock critical:[outputShufflerProcess terminate]. |
|
1210 |
outputShufflerProcess waitUntilTerminated. |
|
1211 |
self shuffleRestFrom:shuffledOutStream to:anOutStream lineWise:lineWise. |
|
1212 |
shuffledOutStream close. |
|
1213 |
]. |
|
1214 |
errorShufflerProcess notNil ifTrue:[ |
|
1215 |
terminateLock critical:[errorShufflerProcess terminate]. |
|
1216 |
errorShufflerProcess waitUntilTerminated. |
|
1217 |
self shuffleRestFrom:shuffledErrStream to:anErrStream lineWise:lineWise. |
|
1218 |
shuffledErrStream close. |
|
1219 |
]. |
|
7497
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7492
diff
changeset
|
1220 |
]. |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1221 |
|
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1222 |
pid notNil ifTrue:[ |
7711 | 1223 |
[ |
1224 |
sema wait. |
|
1225 |
] ifCurtailed:[ |
|
1226 |
"/ terminate the os-command (and all of its forked commands) |
|
1227 |
self terminateProcessGroup:pid. |
|
1228 |
self terminateProcess:pid. |
|
1229 |
self closePid:pid. |
|
8669 | 1230 |
stopShufflers value. |
7711 | 1231 |
] |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1232 |
] ifFalse:[ |
7711 | 1233 |
exitStatus := self osProcessStatusClass processCreationFailure |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1234 |
]. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1235 |
stopShufflers value. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1236 |
exitStatus success ifFalse:[ |
7711 | 1237 |
^ aBlock value:exitStatus |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1238 |
]. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1239 |
^ true |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1240 |
|
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1241 |
" |
7711 | 1242 |
|outStream errStream| |
1243 |
||
1244 |
outStream := '' writeStream. |
|
1245 |
||
1246 |
OperatingSystem executeCommand:'ls -l' |
|
1247 |
inputFrom:'abc' readStream |
|
1248 |
outputTo:outStream |
|
1249 |
errorTo:nil |
|
1250 |
inDirectory:nil |
|
1251 |
lineWise:true |
|
1252 |
onError:[:exitStatus | ^ false]. |
|
1253 |
outStream contents |
|
1254 |
" |
|
1255 |
||
1256 |
" |
|
1257 |
|outStream errStream| |
|
1258 |
||
1259 |
outStream := #[] writeStream. |
|
1260 |
||
1261 |
OperatingSystem executeCommand:'cat' |
|
1262 |
inputFrom:(ByteArray new:5000000) readStream |
|
1263 |
outputTo:outStream |
|
1264 |
errorTo:nil |
|
1265 |
inDirectory:nil |
|
1266 |
lineWise:false |
|
1267 |
onError:[:exitStatus | ^ false]. |
|
1268 |
outStream size |
|
1269 |
" |
|
1270 |
||
1271 |
" |
|
1272 |
|outStream errStream| |
|
1273 |
||
1274 |
outStream := '' writeStream. |
|
1275 |
||
1276 |
OperatingSystem executeCommand:'gpg -s --batch --no-tty --passphrase-fd 0 /tmp/passwd' |
|
1277 |
inputFrom:'bla' readStream |
|
1278 |
outputTo:outStream |
|
1279 |
errorTo:nil |
|
1280 |
inDirectory:nil |
|
1281 |
lineWise:true |
|
1282 |
onError:[:exitStatus | false]. |
|
1283 |
outStream contents |
|
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1284 |
" |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1285 |
! |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1286 |
|
8669 | 1287 |
executeCommand:aCommandString inputFrom:anInStream outputTo:anOutStream errorTo:anErrStream auxFrom:anAuxStream inDirectory:dirOrNil lineWise:lineWise onError:aBlock |
1288 |
^ self |
|
1289 |
executeCommand:aCommandString |
|
1290 |
inputFrom:anInStream |
|
1291 |
outputTo:anOutStream |
|
1292 |
errorTo:anErrStream |
|
1293 |
auxFrom:anAuxStream |
|
1294 |
environment:nil |
|
1295 |
inDirectory:dirOrNil |
|
1296 |
lineWise:lineWise |
|
1297 |
onError:aBlock |
|
7110
808437ea66af
add: #executeCommand:inputFrom:outputTo:errorTo:auxFrom:inDirectory:lineWise:onError:
ca
parents:
7106
diff
changeset
|
1298 |
! |
808437ea66af
add: #executeCommand:inputFrom:outputTo:errorTo:auxFrom:inDirectory:lineWise:onError:
ca
parents:
7106
diff
changeset
|
1299 |
|
8655 | 1300 |
executeCommand:aCommandString inputFrom:inputStreamOrNil outputTo:outStreamOrNil errorTo:errStreamOrNil inDirectory:aDirectory |
1301 |
"much like #executeCommand:, but changes the current directory |
|
1302 |
for the command. Since this is OS specific, use this instead of |
|
1303 |
hardwiring any 'cd ..' command strings into your applictions." |
|
1304 |
||
1305 |
^ self |
|
8669 | 1306 |
executeCommand:aCommandString |
1307 |
inputFrom:inputStreamOrNil |
|
1308 |
outputTo:outStreamOrNil |
|
1309 |
errorTo:errStreamOrNil |
|
1310 |
auxFrom:nil |
|
1311 |
inDirectory:aDirectory |
|
1312 |
lineWise:false |
|
1313 |
onError:[:status| false] |
|
1314 |
||
1315 |
" |
|
1316 |
OperatingSystem executeCommand:'tdump date.obj' inDirectory:'c:\winstx\stx\libbasic\objbc'. |
|
1317 |
OperatingSystem executeCommand:'xxdir date.obj' inDirectory:'c:\winstx\stx\libbasic\objbc'. |
|
1318 |
OperatingSystem executeCommand:'dir' inDirectory:'c:\'. |
|
1319 |
OperatingSystem executeCommand:'dir' |
|
8655 | 1320 |
" |
1321 |
||
1322 |
"Modified: / 20.1.1998 / 17:03:03 / md" |
|
1323 |
"Modified: / 10.11.1998 / 20:28:10 / cg" |
|
1324 |
"Created: / 10.11.1998 / 21:05:45 / cg" |
|
1325 |
! |
|
1326 |
||
8669 | 1327 |
executeCommand:aCommandString inputFrom:anInStream outputTo:anOutStream errorTo:anErrStream inDirectory:dirOrNil lineWise:lineWise onError:aBlock |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1328 |
"execute the unix command specified by the argument, aCommandString. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1329 |
The commandString is passed to a shell for execution - see the description of |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1330 |
'sh -c' in your UNIX manual. |
7119 | 1331 |
Return true if successful, the value from aBlock if not. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1332 |
If not successfull, aBlock is called with an OsProcessStatus |
4847 | 1333 |
(containing the exit status) as argument. |
1334 |
The given in, out and err streams may be arbitrary (Smalltalk-) streams; |
|
1335 |
if any is not an external stream (which is required by the command), |
|
1336 |
extra pipes and shuffler processes are created, which stuff the data into |
|
1337 |
those internal stream(s). |
|
7059 | 1338 |
Nil stream args will execute the command connected to ST/X's standard input, output or |
1339 |
error resp. - i.e. usually, i/o will be from/to the terminal" |
|
6610 | 1340 |
|
7119 | 1341 |
^ self |
8669 | 1342 |
executeCommand:aCommandString |
1343 |
inputFrom:anInStream |
|
1344 |
outputTo:anOutStream |
|
1345 |
errorTo:anErrStream |
|
7711 | 1346 |
auxFrom:nil |
8669 | 1347 |
inDirectory:dirOrNil |
1348 |
lineWise:lineWise |
|
1349 |
onError:aBlock |
|
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1350 |
! |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1351 |
|
6162 | 1352 |
executeCommand:aCommandString inputFrom:anInStream outputTo:anOutStream errorTo:anErrStream inDirectory:dirOrNil onError:aBlock |
1353 |
"execute the unix command specified by the argument, aCommandString. |
|
1354 |
The commandString is passed to a shell for execution - see the description of |
|
1355 |
'sh -c' in your UNIX manual. |
|
7119 | 1356 |
Return true if successful, the value from aBlock if not. |
6162 | 1357 |
If not successfull, aBlock is called with an OsProcessStatus |
1358 |
(containing the exit status) as argument. |
|
1359 |
The given in, out and err streams may be arbitrary (Smalltalk-) streams; |
|
1360 |
if any is not an external stream (which is required by the command), |
|
1361 |
extra pipes and shuffler processes are created, which stuff the data into |
|
1362 |
those internal stream(s). |
|
1363 |
Nil stream args will execute the command connected to ST/X's input, output or |
|
8669 | 1364 |
error resp. - i.e. i/o will be from/to the xterminal" |
1365 |
||
1366 |
^ self |
|
1367 |
executeCommand:aCommandString |
|
1368 |
inputFrom:anInStream |
|
1369 |
outputTo:anOutStream |
|
1370 |
errorTo:anErrStream |
|
1371 |
auxFrom:nil |
|
1372 |
inDirectory:dirOrNil |
|
1373 |
lineWise:false |
|
1374 |
onError:aBlock |
|
6162 | 1375 |
|
1376 |
" |
|
1377 |
OperatingSystem |
|
8669 | 1378 |
executeCommand:'dir' |
1379 |
inputFrom:nil |
|
1380 |
outputTo:nil |
|
1381 |
errorTo:nil |
|
1382 |
inDirectory:'c:' |
|
1383 |
onError:[:status | Transcript flash] |
|
6162 | 1384 |
|
1385 |
OperatingSystem |
|
8669 | 1386 |
executeCommand:'foo' |
1387 |
inputFrom:nil |
|
1388 |
outputTo:nil |
|
1389 |
errorTo:nil |
|
1390 |
inDirectory:'/etc' |
|
1391 |
onError:[:status | Transcript flash] |
|
6162 | 1392 |
|
1393 |
|s| |
|
1394 |
s := '' writeStream. |
|
1395 |
OperatingSystem |
|
8669 | 1396 |
executeCommand:'ls -l' |
1397 |
inputFrom:nil |
|
1398 |
outputTo:s |
|
1399 |
errorTo:nil |
|
1400 |
onError:[:status | Transcript flash]. |
|
6162 | 1401 |
Transcript showCR:s contents. |
1402 |
||
1403 |
|s| |
|
1404 |
s := '' writeStream. |
|
1405 |
OperatingSystem |
|
8669 | 1406 |
executeCommand:'sh foo' |
1407 |
inputFrom:nil |
|
1408 |
outputTo:s |
|
1409 |
errorTo:s |
|
1410 |
onError:[:status | Transcript flash]. |
|
6162 | 1411 |
Transcript showCR:s contents. |
1412 |
" |
|
1413 |
||
1414 |
"Modified: / 25.3.1997 / 11:02:02 / stefan" |
|
1415 |
"Modified: / 28.1.1998 / 14:46:36 / md" |
|
1416 |
"Modified: / 10.11.1998 / 20:48:08 / cg" |
|
1417 |
"Created: / 10.11.1998 / 20:51:11 / cg" |
|
1418 |
! |
|
1419 |
||
6610 | 1420 |
executeCommand:aCommandString inputFrom:anInStream outputTo:anOutStream errorTo:anErrStream onError:aBlock |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1421 |
"execute the unix command specified by the argument, aCommandString. |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1422 |
The commandString is passed to a shell for execution - see the description of |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1423 |
'sh -c' in your UNIX manual. |
7119 | 1424 |
Return true if successful, the value from aBlock if not. |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1425 |
If not successfull, aBlock is called with an OsProcessStatus |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1426 |
(containing the exit status) as argument." |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1427 |
|
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1428 |
^ self |
8669 | 1429 |
executeCommand:aCommandString |
1430 |
inputFrom:anInStream |
|
1431 |
outputTo:anOutStream |
|
1432 |
errorTo:anErrStream |
|
7711 | 1433 |
auxFrom:nil |
1434 |
inDirectory:nil |
|
1435 |
lineWise:false |
|
1436 |
onError:aBlock |
|
1437 |
||
1438 |
" |
|
1439 |
OperatingSystem |
|
8669 | 1440 |
executeCommand:'dir' |
7711 | 1441 |
inputFrom:nil |
1442 |
outputTo:nil |
|
1443 |
errorTo:nil |
|
1444 |
onError:[:status | Transcript flash] |
|
8669 | 1445 |
|
7711 | 1446 |
OperatingSystem |
1447 |
executeCommand:'foo' |
|
1448 |
inputFrom:nil |
|
1449 |
outputTo:nil |
|
1450 |
errorTo:nil |
|
1451 |
onError:[:status | Transcript flash] |
|
1452 |
" |
|
1453 |
" |
|
1454 |
|outStr errStr| |
|
1455 |
||
1456 |
outStr := '' writeStream. |
|
1457 |
errStr := '' writeStream. |
|
1458 |
OperatingSystem |
|
1459 |
executeCommand:'ls' |
|
1460 |
inputFrom:nil |
|
1461 |
outputTo:outStr |
|
1462 |
errorTo:errStr |
|
1463 |
onError:[:status | Transcript flash]. |
|
1464 |
Transcript show:'out:'; showCR:outStr contents. |
|
1465 |
Transcript show:'err:'; showCR:errStr contents. |
|
1466 |
" |
|
1467 |
" |
|
1468 |
|outStr errStr| |
|
1469 |
||
1470 |
outStr := '' writeStream. |
|
1471 |
errStr := '' writeStream. |
|
1472 |
OperatingSystem |
|
1473 |
executeCommand:'ls /fooBar' |
|
1474 |
inputFrom:nil |
|
1475 |
outputTo:outStr |
|
1476 |
errorTo:errStr |
|
1477 |
onError:[:status | Transcript flash]. |
|
1478 |
Transcript show:'out:'; showCR:outStr contents. |
|
1479 |
Transcript show:'err:'; showCR:errStr contents. |
|
6610 | 1480 |
" |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1481 |
|
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1482 |
"Modified: / 10.11.1998 / 20:51:39 / cg" |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1483 |
! |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1484 |
|
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1485 |
executeCommand:aCommandString onError:aBlock |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1486 |
"execute the unix command specified by the argument, aCommandString. |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1487 |
The commandString is passed to a shell for execution - see the description of |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1488 |
'sh -c' in your UNIX manual. |
7119 | 1489 |
Return true if successful, the value from aBlock if not. |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1490 |
If not successfull, aBlock is called with an OsProcessStatus |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1491 |
(containing the exit status) as argument." |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1492 |
|
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1493 |
^ self |
8669 | 1494 |
executeCommand:aCommandString |
1495 |
inputFrom:nil |
|
1496 |
outputTo:nil |
|
1497 |
errorTo:nil |
|
7711 | 1498 |
auxFrom:nil |
1499 |
inDirectory:nil |
|
1500 |
lineWise:false |
|
1501 |
onError:aBlock |
|
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1502 |
|
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1503 |
"unix: |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1504 |
|
8669 | 1505 |
OperatingSystem executeCommand:'sleep 30' onError:[]. |
1506 |
OperatingSystem executeCommand:'pwd' onError:[:status|status inspect]. |
|
1507 |
OperatingSystem executeCommand:'ls -l' onError:[]. |
|
1508 |
OperatingSystem executeCommand:'invalidCommand' onError:[:status| status inspect]. |
|
1509 |
OperatingSystem executeCommand:'rm /tmp/foofoofoofoo'onError:[:status | status inspect]. |
|
1510 |
||
1511 |
OperatingSystem executeCommand:'dir' onError:[]. |
|
1512 |
OperatingSystem executeCommand:'foo' onError:[]. |
|
1513 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1514 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1515 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1516 |
"Modified: / 25.3.1997 / 11:06:43 / stefan" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1517 |
"Modified: / 28.1.1998 / 14:46:56 / md" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1518 |
"Created: / 5.6.1998 / 19:02:09 / cg" |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1519 |
"Modified: / 10.11.1998 / 20:55:02 / cg" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1520 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1521 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1522 |
executeCommand:aCommandString onError:aBlock inDirectory:aDirectory |
7119 | 1523 |
"OBSOLETE for backward compatibility. |
1524 |
execute the unix command specified by the argument, aCommandString. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1525 |
The commandString is passed to a shell for execution - see the description of |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1526 |
'sh -c' in your UNIX manual. |
7119 | 1527 |
Return true if successful, the value from aBlock if not. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1528 |
If not successfull, aBlock is called with an OsProcessStatus |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1529 |
(containing the exit status) as argument." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1530 |
|
5861 | 1531 |
<resource:#obsolete> |
1532 |
||
4849 | 1533 |
self obsoleteMethodWarning:'use executeCommand:inDirectory:onError:'. |
1534 |
||
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1535 |
^ self |
8669 | 1536 |
executeCommand:aCommandString |
1537 |
inputFrom:nil |
|
1538 |
outputTo:nil |
|
1539 |
errorTo:nil |
|
7711 | 1540 |
auxFrom:nil |
1541 |
inDirectory:aDirectory |
|
1542 |
lineWise:false |
|
1543 |
onError:aBlock |
|
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1544 |
|
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1545 |
"Modified: / 10.11.1998 / 20:54:37 / cg" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1546 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1547 |
|
7119 | 1548 |
executeCommand:aCommandString outputTo:anOutStreamOrNil |
1549 |
"execute the unix command specified by the argument, aCommandString. |
|
1550 |
The commandString is passed to a shell for execution - see the description of |
|
1551 |
'sh -c' in your UNIX manual. |
|
1552 |
Return true if successful, false otherwise." |
|
1553 |
||
1554 |
^ self |
|
8669 | 1555 |
executeCommand:aCommandString |
1556 |
inputFrom:nil |
|
1557 |
outputTo:anOutStreamOrNil |
|
1558 |
errorTo:nil |
|
7711 | 1559 |
auxFrom:nil |
1560 |
inDirectory:nil |
|
1561 |
lineWise:false |
|
1562 |
onError:[:status| false] |
|
7119 | 1563 |
|
1564 |
" |
|
8669 | 1565 |
String streamContents:[:s|OperatingSystem |
1566 |
executeCommand:'ls' |
|
7711 | 1567 |
outputTo:s |
7119 | 1568 |
] |
1569 |
" |
|
1570 |
||
1571 |
" |
|
8669 | 1572 |
String streamContents:[:s|OperatingSystem |
1573 |
executeCommand:'pwd' |
|
7711 | 1574 |
outputTo:s |
8669 | 1575 |
] |
7119 | 1576 |
" |
1577 |
! |
|
1578 |
||
4849 | 1579 |
executeCommand:aCommandString outputTo:outStreamOrNil errorTo:errStreamOrNil inDirectory:aDirectory |
1580 |
"much like #executeCommand:, but changes the current directory |
|
1581 |
for the command. Since this is OS specific, use this instead of |
|
1582 |
hardwiring any 'cd ..' command strings into your applictions." |
|
1583 |
||
1584 |
^ self |
|
7711 | 1585 |
executeCommand:aCommandString |
1586 |
inputFrom:nil |
|
1587 |
outputTo:outStreamOrNil |
|
1588 |
errorTo:errStreamOrNil |
|
1589 |
auxFrom:nil |
|
1590 |
inDirectory:aDirectory |
|
1591 |
lineWise:false |
|
1592 |
onError:[:status| false] |
|
4849 | 1593 |
|
1594 |
" |
|
8669 | 1595 |
OperatingSystem executeCommand:'tdump date.obj' inDirectory:'c:\winstx\stx\libbasic\objbc'. |
1596 |
OperatingSystem executeCommand:'xxdir date.obj' inDirectory:'c:\winstx\stx\libbasic\objbc'. |
|
1597 |
OperatingSystem executeCommand:'dir' inDirectory:'c:\'. |
|
1598 |
OperatingSystem executeCommand:'dir' |
|
4849 | 1599 |
" |
1600 |
||
1601 |
"Modified: / 20.1.1998 / 17:03:03 / md" |
|
1602 |
"Modified: / 10.11.1998 / 20:28:10 / cg" |
|
1603 |
"Created: / 10.11.1998 / 21:05:45 / cg" |
|
1604 |
! |
|
1605 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1606 |
getCommandOutputFrom:aCommand |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1607 |
"execute a simple command (such as hostname) and |
5482 | 1608 |
return the commands first line of output as a string (forget stdErr). |
4204 | 1609 |
If the command generates multiple output lines, only the first line is returned. |
1610 |
If the commands does not generate any output, an empty string is returned; |
|
1611 |
if the command fails, nil is returned." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1612 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1613 |
|result| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1614 |
|
5482 | 1615 |
result := self getCommandOutputFrom:aCommand maxNumberOfLines:1 errorDisposition:#discard. |
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1616 |
result notNil ifTrue:[ |
7711 | 1617 |
^ result firstIfEmpty:[''] |
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1618 |
]. |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1619 |
^ result |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1620 |
|
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1621 |
" |
8669 | 1622 |
OperatingSystem getCommandOutputFrom:'hostname' |
1623 |
OperatingSystem getCommandOutputFrom:'pwd' |
|
1624 |
OperatingSystem getCommandOutputFrom:'sleep 1' |
|
1625 |
OperatingSystem getCommandOutputFrom:'foo' |
|
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1626 |
" |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1627 |
|
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1628 |
! |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1629 |
|
5482 | 1630 |
getCommandOutputFrom:aCommand maxNumberOfLines:numLinesOrNil errorDisposition:errorDisposition |
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1631 |
"execute a simple command (such as hostname) and |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1632 |
return the commands output as a collection of strings, |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1633 |
but only up to the given number of lines (if non-nil). |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1634 |
If the command generates more output, only the first nLines are returned |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1635 |
(but the command is allowed to finish execution). |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1636 |
If the commands does not generate any output, an empty string is returned; |
5482 | 1637 |
if the command fails, nil is returned. |
1638 |
errorDisposition controls where the stdErr output should go, |
|
1639 |
and may be one of #discard, #inline or #stderr (default). |
|
8669 | 1640 |
#discard causes stderr to be discarded (/dev/null), |
5482 | 1641 |
#inline causes it to be written to smalltalks own stdout and |
1642 |
#stderr causes it to be written to smalltalks own stderr. |
|
1643 |
Nil is treated like #stderr" |
|
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1644 |
|
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1645 |
|result| |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1646 |
|
4200 | 1647 |
PipeFailed ~~ true ifTrue:[ |
7711 | 1648 |
PipeStream openErrorSignal handle:[:ex | |
1649 |
PipeFailed := true. |
|
1650 |
'OperatingSystem [warning]: cannot fork/popen' errorPrintCR. |
|
1651 |
ex return. |
|
1652 |
] do:[ |
|
1653 |
|p line| |
|
1654 |
||
8669 | 1655 |
p := PipeStream |
7711 | 1656 |
readingFrom:aCommand |
1657 |
errorDisposition:errorDisposition |
|
1658 |
inDirectory:nil. |
|
1659 |
result := StringCollection new. |
|
1660 |
[p atEnd] whileFalse:[ |
|
1661 |
line := p nextLine. |
|
8669 | 1662 |
(numLinesOrNil isNil |
7711 | 1663 |
or:[result size < numLinesOrNil]) ifTrue:[ |
1664 |
result add:line |
|
1665 |
]. |
|
1666 |
]. |
|
1667 |
p close. |
|
1668 |
p exitStatus success ifFalse:[ |
|
1669 |
result isEmpty ifTrue:[ |
|
1670 |
result := nil |
|
1671 |
] |
|
1672 |
]. |
|
1673 |
]. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1674 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1675 |
^ result |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1676 |
|
4204 | 1677 |
" |
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1678 |
OperatingSystem getCommandOutputFrom:'ls' maxNumberOfLines:1 |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1679 |
OperatingSystem getCommandOutputFrom:'ls' maxNumberOfLines:10 |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1680 |
OperatingSystem getCommandOutputFrom:'ls' maxNumberOfLines:nil |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1681 |
OperatingSystem getCommandOutputFrom:'foo' maxNumberOfLines:nil |
4204 | 1682 |
" |
1683 |
||
1684 |
"Modified: / 19.5.1999 / 14:25:02 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1685 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1686 |
|
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1687 |
getFullCommandOutputFrom:aCommand |
5482 | 1688 |
"execute a command and |
5483 | 1689 |
return the commands output as a collection of strings (ignoring stdErr). |
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1690 |
If the commands does not generate any output, an empty string is returned; |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1691 |
if the command fails, nil is returned." |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1692 |
|
5483 | 1693 |
^ self getCommandOutputFrom:aCommand maxNumberOfLines:nil errorDisposition:#discard |
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1694 |
|
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1695 |
" |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1696 |
OperatingSystem getFullCommandOutputFrom:'mt status' |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1697 |
" |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1698 |
|
8587 | 1699 |
! ! |
1700 |
||
1701 |
!AbstractOperatingSystem class methodsFor:'executing OS commands-queries'! |
|
1702 |
||
1703 |
canExecuteCommand:aCommandString |
|
1704 |
"return true, if the OS can execute aCommand. |
|
1705 |
For now, this only works with UNIX." |
|
1706 |
||
1707 |
|fn fullPath| |
|
1708 |
||
1709 |
fullPath := (self pathOfCommand:aCommandString). |
|
1710 |
fullPath isNil ifTrue:[^ false]. |
|
1711 |
fn := fullPath asFilename. |
|
1712 |
^ fn exists and:[fn isExecutableProgram]. |
|
1713 |
||
1714 |
" |
|
8669 | 1715 |
OperatingSystem canExecuteCommand:'fooBar' |
1716 |
OperatingSystem canExecuteCommand:'ls' |
|
9380 | 1717 |
OperatingSystem canExecuteCommand:'cvs' |
8801 | 1718 |
OperatingSystem canExecuteCommand:'diff' |
9380 | 1719 |
OperatingSystem canExecuteCommand:'cvs.exe' |
8587 | 1720 |
" |
1721 |
||
1722 |
"Created: 4.11.1995 / 19:13:54 / cg" |
|
1723 |
! |
|
1724 |
||
1725 |
commandAndArgsForOSCommand:aCommandString |
|
1726 |
"get a shell and shell arguments for command execution" |
|
1727 |
||
1728 |
self subclassResponsibility |
|
1729 |
! |
|
1730 |
||
1731 |
executableFileExtensions |
|
1732 |
"return a collection of extensions for executable program files. |
|
1733 |
Only req'd for msdos & vms like systems ..." |
|
1734 |
||
1735 |
^ #('') |
|
1736 |
||
1737 |
"Created: 2.5.1997 / 11:42:29 / cg" |
|
1738 |
! |
|
1739 |
||
1740 |
nameOfSTXExecutable |
|
1741 |
"return the name of the running ST/X executable program. |
|
1742 |
Usually, 'stx' is returned - |
|
1743 |
but may be different for standAlone apps (or winstx.exe)." |
|
1744 |
||
1745 |
%{ |
|
1746 |
extern char *__stxExecutableName__(); |
|
1747 |
||
1748 |
RETURN (__MKSTRING(__stxExecutableName__())); |
|
1749 |
%} |
|
1750 |
" |
|
1751 |
OperatingSystem nameOfSTXExecutable |
|
1752 |
" |
|
1753 |
! |
|
1754 |
||
1755 |
pathOfCommand:aCommand |
|
1756 |
"find where aCommand's executable file is; |
|
1757 |
return its full pathName if there is such a command, otherwise |
|
1758 |
return nil." |
|
1759 |
||
1760 |
^ self subclassResponsibility |
|
1761 |
! |
|
1762 |
||
1763 |
pathOfSTXExecutable |
|
1764 |
"return the full path of the running ST/X executable program. |
|
8669 | 1765 |
Usually, '.../stx' is returned - |
8587 | 1766 |
but may be different for standAlone apps (or winstx.exe)." |
1767 |
||
1768 |
^ self pathOfCommand:(self nameOfSTXExecutable) |
|
1769 |
||
1770 |
" |
|
1771 |
OperatingSystem pathOfSTXExecutable |
|
1772 |
" |
|
1773 |
! ! |
|
1774 |
||
1775 |
!AbstractOperatingSystem class methodsFor:'executing OS commands-wrappers'! |
|
1776 |
||
1777 |
exec:aCommandPath withArguments:argArray |
|
1778 |
"execute the OS command specified by the argument, aCommandPath, with |
|
1779 |
arguments in argArray (no arguments, if nil). |
|
1780 |
If successful, this method does NOT return and smalltalk is gone. |
|
8669 | 1781 |
If not successful, it does return. |
8587 | 1782 |
Can be used on UNIX with fork or on other systems to chain to another program." |
7656 | 1783 |
|
8669 | 1784 |
^ self |
1785 |
exec:aCommandPath |
|
8587 | 1786 |
withArguments:argArray |
1787 |
environment:nil |
|
1788 |
fileDescriptors:#(0 1 2) |
|
8669 | 1789 |
fork:false |
8587 | 1790 |
newPgrp:false |
1791 |
inDirectory:nil |
|
1792 |
||
1793 |
"/ never reached ... |
|
1794 |
||
1795 |
"Modified: / 12.11.1998 / 14:44:26 / cg" |
|
1796 |
! |
|
1797 |
||
1798 |
exec:aCommandPath withArguments:argArray fileDescriptors:fileDescriptors fork:doFork newPgrp:newPgrp inDirectory:aDirectory |
|
8669 | 1799 |
^ self |
8587 | 1800 |
exec:aCommandPath |
1801 |
withArguments:argArray |
|
1802 |
environment:nil |
|
1803 |
fileDescriptors:fileDescriptors |
|
8669 | 1804 |
fork:doFork |
8587 | 1805 |
newPgrp:newPgrp |
1806 |
inDirectory:aDirectory |
|
1807 |
! |
|
1808 |
||
1809 |
exec:aCommandPath withArguments:argArray fork:doFork |
|
1810 |
"execute an OS command without I/O redirection. |
|
1811 |
The command reads its input and writes its output |
|
1812 |
from/to whatever terminal device ST/X was started |
|
1813 |
(typically, the terminal window)" |
|
1814 |
||
8669 | 1815 |
^ self |
1816 |
exec:aCommandPath |
|
1817 |
withArguments:argArray |
|
8587 | 1818 |
environment:nil |
1819 |
fileDescriptors:#(0 1 2) |
|
8669 | 1820 |
fork:doFork |
8587 | 1821 |
newPgrp:false |
1822 |
inDirectory:nil |
|
1823 |
||
1824 |
" |
|
1825 |
|id| |
|
1826 |
||
1827 |
id := OperatingSystem fork. |
|
1828 |
id == 0 ifTrue:[ |
|
1829 |
'I am the child'. |
|
8669 | 1830 |
OperatingSystem |
1831 |
exec:'/bin/ls' |
|
8587 | 1832 |
withArguments:#('ls' '/tmp') |
1833 |
fork:false. |
|
1834 |
'not reached'. |
|
1835 |
] |
|
1836 |
" |
|
1837 |
||
1838 |
" |
|
1839 |
|id| |
|
1840 |
||
1841 |
id := OperatingSystem fork. |
|
1842 |
id == 0 ifTrue:[ |
|
1843 |
'I am the child'. |
|
8669 | 1844 |
OperatingSystem |
1845 |
exec:'/bin/sh' |
|
8587 | 1846 |
withArguments:#('sh' '-c' 'sleep 2;echo 1;sleep 2;echo 2') |
1847 |
fork:false. |
|
1848 |
'not reached'. |
|
1849 |
]. |
|
1850 |
id printNL. |
|
1851 |
(Delay forSeconds:3.5) wait. |
|
1852 |
'killing ...' printNL. |
|
1853 |
OperatingSystem sendSignal:(OperatingSystem sigTERM) to:id. |
|
1854 |
OperatingSystem sendSignal:(OperatingSystem sigKILL) to:id |
|
1855 |
" |
|
1856 |
||
1857 |
"Modified: / 15.7.1997 / 15:54:32 / stefan" |
|
1858 |
"Modified: / 12.11.1998 / 14:44:46 / cg" |
|
1859 |
! |
|
1860 |
||
1861 |
exec:aCommandPath withArguments:argArray fork:doFork inDirectory:aDirectory |
|
1862 |
"execute an OS command without I/O redirection. |
|
1863 |
The command reads its input and writes its output |
|
1864 |
from/to whatever terminal device ST/X was started |
|
1865 |
(typically, the terminal window)" |
|
1866 |
||
8669 | 1867 |
^ self |
8587 | 1868 |
exec:aCommandPath |
1869 |
withArguments:argArray |
|
1870 |
environment:nil |
|
1871 |
fileDescriptors:#(0 1 2) |
|
8669 | 1872 |
fork:doFork |
8587 | 1873 |
newPgrp:false |
1874 |
inDirectory:aDirectory |
|
1875 |
||
1876 |
" |
|
1877 |
|id| |
|
1878 |
||
1879 |
id := OperatingSystem fork. |
|
1880 |
id == 0 ifTrue:[ |
|
1881 |
'I am the child'. |
|
8669 | 1882 |
OperatingSystem |
1883 |
exec:'/bin/ls' |
|
8587 | 1884 |
withArguments:#('ls' '/tmp') |
1885 |
fork:false. |
|
1886 |
'not reached'. |
|
1887 |
] |
|
1888 |
" |
|
1889 |
||
1890 |
" |
|
1891 |
|id| |
|
1892 |
||
1893 |
id := OperatingSystem fork. |
|
1894 |
id == 0 ifTrue:[ |
|
1895 |
'I am the child'. |
|
8669 | 1896 |
OperatingSystem |
1897 |
exec:'/bin/sh' |
|
8587 | 1898 |
withArguments:#('sh' '-c' 'sleep 2;echo 1;sleep 2;echo 2') |
1899 |
fork:false. |
|
1900 |
'not reached'. |
|
1901 |
]. |
|
1902 |
id printNL. |
|
1903 |
(Delay forSeconds:3.5) wait. |
|
1904 |
'killing ...' printNL. |
|
1905 |
OperatingSystem sendSignal:(OperatingSystem sigTERM) to:id. |
|
1906 |
OperatingSystem sendSignal:(OperatingSystem sigKILL) to:id |
|
1907 |
" |
|
1908 |
||
1909 |
"Created: / 28.1.1998 / 14:14:03 / md" |
|
1910 |
"Modified: / 28.1.1998 / 14:14:45 / md" |
|
1911 |
"Modified: / 12.11.1998 / 14:45:06 / cg" |
|
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1912 |
! ! |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1913 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1914 |
!AbstractOperatingSystem class methodsFor:'file access'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1915 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1916 |
closeFd:anInteger |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1917 |
"low level close of a filedescriptor" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1918 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1919 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1920 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1921 |
|
7699 | 1922 |
copyFromFd:inFd toFd:outFd startIndex:startIdx count:count |
1923 |
"directly copy from one FD to another (if supported by the OS)" |
|
1924 |
||
1925 |
^ 0 "/ not supported |
|
1926 |
! |
|
1927 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1928 |
createDirectory:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1929 |
"create a new directory with name 'aPathName', which may be an absolute |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1930 |
path, or relative to the current directory. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1931 |
Return true if successful (or the directory existed already), false if failed. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1932 |
This is a low-level entry - use Filename protocol for compatibility." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1933 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1934 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1935 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1936 |
|
6292 | 1937 |
createFileForReadAppend:pathName |
1938 |
self subclassResponsibility |
|
1939 |
! |
|
1940 |
||
1941 |
createFileForReadWrite:pathName |
|
1942 |
self subclassResponsibility |
|
1943 |
! |
|
1944 |
||
3758
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1945 |
createHardLinkFrom:oldPath to:newPath |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1946 |
"link the file 'oldPath' to 'newPath'. The link will be a hard link. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1947 |
Return true if successful, false if not." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1948 |
|
3758
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1949 |
"/ |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1950 |
"/ assume that this OperatingSystem does not support links |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1951 |
"/ |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1952 |
^ UnsupportedOperationSignal raise |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1953 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1954 |
"Created: / 13.8.1998 / 21:37:12 / cg" |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1955 |
"Modified: / 13.8.1998 / 21:38:39 / cg" |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1956 |
! |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1957 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1958 |
createSymbolicLinkFrom:oldPath to:newPath |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1959 |
"make a link from the file 'oldPath' to the file 'newPath'. |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1960 |
The link will be a soft (symbolic) link. |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1961 |
Return true if successful, false if not." |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1962 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1963 |
"/ |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1964 |
"/ assume that this OperatingSystem does not support symbolic links |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1965 |
"/ |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1966 |
^ UnsupportedOperationSignal raise |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1967 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1968 |
"Created: / 13.8.1998 / 21:38:24 / cg" |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1969 |
"Modified: / 13.8.1998 / 21:38:43 / cg" |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1970 |
! |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1971 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1972 |
linkFile:oldPath to:newPath |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1973 |
"link the file 'oldPath' to 'newPath'. The link will be a hard link. |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1974 |
Return true if successful, false if not. |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1975 |
This method has been renamed - it remains in existance for |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1976 |
backward compatibility." |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1977 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1978 |
^ self createHardLinkFrom:oldPath to:newPath |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1979 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1980 |
" |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1981 |
OperatingSystem linkFile:'foo' to:'bar' |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1982 |
" |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1983 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
1984 |
"Modified: / 13.8.1998 / 21:37:24 / cg" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1985 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1986 |
|
6291 | 1987 |
openFile:pathName withMode:openModeSymbol attributes:attributeSpec |
8669 | 1988 |
"open a file, return an os specific fileHandle. |
6291 | 1989 |
openmode is a symbol defining the way to open |
1990 |
valid modes are: |
|
7711 | 1991 |
#read |
8669 | 1992 |
#write |
7711 | 1993 |
#readWrite |
1994 |
#appendWrite |
|
1995 |
#appendReadWrite |
|
1996 |
#createWrite |
|
1997 |
#createReadWrite |
|
6291 | 1998 |
|
1999 |
attributeSpec is an additional argument, currently only used with VMS |
|
2000 |
- it allows a file to be created as fixedRecord, variableRecord, streamLF, streamCR, ... |
|
2001 |
||
2002 |
In VMS, if nonNil, it must consist of an array of strings (max:10), giving additional |
|
2003 |
attributes (see fopen description). |
|
2004 |
Passing a nil specifies the default format (streamLF) - ST/X always invokes this with nil. |
|
2005 |
This argument is ignored in UNIX & MSDOS systems. |
|
2006 |
||
2007 |
This is a private entry, but maybe useful to open/create a file in a special mode, |
|
2008 |
which is proprietrary to the operatingSystem." |
|
2009 |
||
2010 |
self subclassResponsibility |
|
2011 |
! |
|
2012 |
||
6292 | 2013 |
openFileForAppend:pathName |
2014 |
self subclassResponsibility |
|
2015 |
! |
|
2016 |
||
2017 |
openFileForRead:pathName |
|
2018 |
self subclassResponsibility |
|
2019 |
! |
|
2020 |
||
2021 |
openFileForReadAppend:pathName |
|
2022 |
self subclassResponsibility |
|
2023 |
! |
|
2024 |
||
2025 |
openFileForReadWrite:pathName |
|
2026 |
self subclassResponsibility |
|
2027 |
! |
|
2028 |
||
2029 |
openFileForWrite:pathName |
|
2030 |
self subclassResponsibility |
|
2031 |
! |
|
2032 |
||
4149 | 2033 |
recursiveCopyDirectory:fullPathName to:destinationPathName |
8669 | 2034 |
"copy the directory named 'fullPathName' and all contained |
4149 | 2035 |
files/directories recursively to destinationPathName. |
2036 |
Return true if successful. |
|
2037 |
Here, false is returned and the caller should be prepared |
|
2038 |
for a fallBack solution. |
|
8669 | 2039 |
Notice: |
7711 | 2040 |
this is not a public interface; instead, it is used |
2041 |
internally by the Filename class, to try a fast copy |
|
2042 |
before doing things manually. |
|
2043 |
Please use Filename recursiveCopyTo:" |
|
4149 | 2044 |
|
2045 |
^ false |
|
2046 |
||
2047 |
" |
|
2048 |
OperatingSystem recursiveCopyDirectory:'.' to:'/tmp/foo' |
|
2049 |
OperatingSystem recursiveRemoveDirectory:'/tmp/foo' |
|
2050 |
" |
|
2051 |
||
2052 |
"Modified: / 5.5.1999 / 13:29:16 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2053 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2054 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2055 |
recursiveCreateDirectory:dirName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2056 |
"create a directory - with all parent dirs if needed. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2057 |
Return true if successful, false otherwise. If false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2058 |
is returned, a partial created tree may be left, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2059 |
which is not cleaned-up here." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2060 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2061 |
self createDirectory:dirName. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2062 |
(self isDirectory:dirName) ifFalse:[ |
7711 | 2063 |
(self recursiveCreateDirectory:(dirName asFilename directoryName)) ifFalse:[^ false]. |
2064 |
^ self createDirectory:dirName |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2065 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2066 |
^ true |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2067 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2068 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2069 |
OperatingSystem recursiveCreateDirectory:'foo/bar/baz' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2070 |
OperatingSystem recursiveRemoveDirectory:'foo' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2071 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2072 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2073 |
"Modified: 7.3.1996 / 15:26:22 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2074 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2075 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2076 |
recursiveRemoveDirectory:fullPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2077 |
"remove the directory named 'fullPathName' and all contained files/directories. |
4149 | 2078 |
Return true if successful. |
2079 |
Here, false is returned and the caller should be prepared |
|
2080 |
for a fallBack solution. |
|
8669 | 2081 |
Notice: |
7711 | 2082 |
this is not a public interface; instead, it is used |
2083 |
internally by the Filename class, to try a fast remove |
|
2084 |
before doing things manually. |
|
2085 |
Please use Filename recursiveRemoveDirectory:" |
|
4149 | 2086 |
|
2087 |
^ false |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2088 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2089 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2090 |
OperatingSystem recursiveCreateDirectory:'foo/bar/baz' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2091 |
OperatingSystem recursiveRemoveDirectory:'foo' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2092 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2093 |
|
4149 | 2094 |
"Modified: / 5.5.1999 / 13:30:11 / cg" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2095 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2096 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2097 |
removeDirectory:fullPathName |
8669 | 2098 |
"remove the directory named 'fullPathName'. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2099 |
The directory must be empty and you must have appropriate access rights. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2100 |
Return true if successful, false if directory is not empty or no permission. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2101 |
This is a lowLevel entry - use Filename protocol for compatibility." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2102 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2103 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2104 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2105 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2106 |
removeFile:fullPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2107 |
"remove the file named 'fullPathName'; return true if successful. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2108 |
This is a lowLevel entry - use Filename protocol for compatibility." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2109 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2110 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2111 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2112 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2113 |
renameFile:oldPath to:newPath |
8669 | 2114 |
"rename the file 'oldPath' to 'newPath'. |
2115 |
Someone else has to care for the names to be correct and |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2116 |
correct for the OS used - therefore, this should not be called |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2117 |
directlt. Instead, use Filename protocol to rename; this cares for |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2118 |
any invalid names. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2119 |
Returns true if successful, false if not" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2120 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2121 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2122 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2123 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2124 |
truncateFile:aPathName to:newSize |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2125 |
"change a files size return true on success, false on failure. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2126 |
This may not be supported on all architectures. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2127 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2128 |
This is a low-level entry - use Filename protocol." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2129 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2130 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2131 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2132 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2133 |
!AbstractOperatingSystem class methodsFor:'file access rights'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2134 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2135 |
accessMaskFor:aSymbol |
8669 | 2136 |
"return the access bits mask for numbers as returned by |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2137 |
OperatingSystem>>accessModeOf: |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2138 |
and expected by OperatingSystem>>changeAccessModeOf:to:. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2139 |
Since these numbers are OS dependent, always use the mask |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2140 |
(never hardcode 8rxxx into your code)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2141 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2142 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2143 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2144 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2145 |
accessModeOf:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2146 |
"return a number representing access rights rwxrwxrwx for owner, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2147 |
group and others. Return nil if such a file does not exist. |
8669 | 2148 |
Notice that the returned number is OS dependent - use the |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2149 |
modeMasks as returned by OperatingSystem>>accessMaskFor:" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2150 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2151 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2152 |
this could have been implemented as: |
7711 | 2153 |
(self infoOf:aPathName) at:#mode |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2154 |
but for huge directory searches the code below is faster |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2155 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2156 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2157 |
^ (self infoOf:aPathName) at:#mode |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2158 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2159 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2160 |
(OperatingSystem accessModeOf:'/') printStringRadix:8 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2161 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2162 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2163 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2164 |
changeAccessModeOf:aPathName to:modeBits |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2165 |
"change the access rights of aPathName to the OS dependent modeBits. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2166 |
You should construct this mask using accessMaskFor, to be OS |
8669 | 2167 |
independent. Return true if changed, |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2168 |
false if such a file does not exist or change was not allowd." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2169 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2170 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2171 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2172 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2173 |
!AbstractOperatingSystem class methodsFor:'file locking'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2174 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2175 |
lockFD:aFileDescriptor shared:isSharedReadLock blocking:blockIfLocked |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2176 |
"set a lock on the file represented by aFileDescriptor. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2177 |
(such as returned by ExternalStream>>fileDescriptor). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2178 |
On some systems, only advisory locks are available - |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2179 |
these depends on other accessors to also perform the locking operation. |
8669 | 2180 |
If they do not, they may still access the file |
2181 |
(on some systems, locks are mandatory, on others, they are advisory). |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2182 |
The isSharedReadLock argument (if true) specifies if multiple readers |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2183 |
are to be allowed - if false, they are not. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2184 |
On some systems, all locks are non-exclusive locks. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2185 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2186 |
Returns true, if the lock was aquired, false otherwise. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2187 |
|
8669 | 2188 |
Notice, that not all OS's support these locks; |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2189 |
on some, this may simply be a no-op. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2190 |
Also notice, that some systems block the process, to wait for the lock. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2191 |
This can (again: on some systems) be avoided by passing a false blockIfLocked |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2192 |
argument." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2193 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2194 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2195 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2196 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2197 |
supportsFileLinks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2198 |
"return true, if the OS supports file links (hard links). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2199 |
Typically, only unix returns true here." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2200 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2201 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2202 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2203 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2204 |
supportsFileLocks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2205 |
"return true, if the OS supports file locking" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2206 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2207 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2208 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2209 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2210 |
OperatingSystem supportsFileLocks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2211 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2212 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2213 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2214 |
supportsNonBlockingFileLocks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2215 |
"return true, if the OS supports nonBlocking file locking |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2216 |
(i.e. with immediate return instead of waiting for the lock)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2217 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2218 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2219 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2220 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2221 |
OperatingSystem supportsNonBlockingFileLocks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2222 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2223 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2224 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2225 |
supportsSharedLocks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2226 |
"return true, if the OS supports shared (i.e. multiple reader) |
4147 | 2227 |
file locking. Assume false here - redefined in concrete classes." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2228 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2229 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2230 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2231 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2232 |
OperatingSystem supportsNonBlockingFileLocks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2233 |
" |
4147 | 2234 |
|
2235 |
"Modified: / 5.5.1999 / 01:08:03 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2236 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2237 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2238 |
supportsSymbolicLinks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2239 |
"return true, if the OS supports symbolic links on files/directories. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2240 |
Typically, only Unix returns true here" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2241 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2242 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2243 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2244 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2245 |
unlockFD:aFileDescriptor |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2246 |
"clear a file lock on the file represented by aFileDescriptor, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2247 |
which was previously aquired by #lockFD:. |
8669 | 2248 |
Return false, if the unlock failed |
2249 |
(which may happens when a wrong fd is passed, |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2250 |
no lock was set previously, or the systsem does not support locks). |
8669 | 2251 |
Notice, that not all OS's support file locks; |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2252 |
on some, this may simply be a no-op." |
8669 | 2253 |
|
3826 | 2254 |
^ false |
2255 |
||
2256 |
"Modified: / 10.9.1998 / 17:54:15 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2257 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2258 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2259 |
!AbstractOperatingSystem class methodsFor:'file queries'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2260 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2261 |
caseSensitiveFilenames |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2262 |
"return true, if the OS has caseSensitive file naming. |
8669 | 2263 |
On MSDOS, this will return false; |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2264 |
on a real OS, we return true." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2265 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2266 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2267 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2268 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2269 |
compressPath:pathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2270 |
"return the pathName compressed - that is, remove all ..-entries |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2271 |
and . entries. This does not always (in case of symbolic links) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2272 |
return the true pathName and is therefore used as a fallback |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2273 |
if realPath and popen failed." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2274 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2275 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2276 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2277 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2278 |
directoryNameOf:aPath |
5861 | 2279 |
<resource:#obsolete> |
2280 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2281 |
self obsoleteMethodWarning:'use asFilename directoryName'. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2282 |
^ aPath asFilename directoryName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2283 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2284 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2285 |
fileSeparator |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2286 |
"return the character used to separate names in a path. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2287 |
This character differs for MSDOS and other systems, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2288 |
(but those are currently not supported - so this is some |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2289 |
preparation for the future)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2290 |
|
3736 | 2291 |
^ $/ "/ must be redefined for systems, where this is not true (i.e. MSDOS) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2292 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2293 |
|
4224
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2294 |
getDiskInfoOf:aDirectoryPath |
8669 | 2295 |
"return some disk info. |
4224
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2296 |
The amount of information returned depends upon the OS, and is |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2297 |
not guaranteed to be consistent across architectures. |
4226 | 2298 |
On unix and msdos, the information returned is (at least): |
7711 | 2299 |
freeBytes |
2300 |
totalBytes |
|
4224
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2301 |
Do not depend on any information being present in the returned dictionary; |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2302 |
users of this method should always use #at:ifAbsent:, and care for the absent case. |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2303 |
Nil is returned if no such information can be obtained. |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2304 |
" |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2305 |
|
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2306 |
^ nil |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2307 |
|
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2308 |
" |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2309 |
OperatingSystem getDiskInfoOf:'/' |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2310 |
OperatingSystem getDiskInfoOf:'.' |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2311 |
" |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2312 |
|
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2313 |
"Modified: / 22.5.1999 / 00:36:06 / cg" |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2314 |
! |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2315 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2316 |
getDriveList |
8669 | 2317 |
"return a list of volumes in the system. |
2318 |
On unix, no such thing like a volume exists |
|
2319 |
- there, a syntetic list with root, home & current is returned. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2320 |
On MSDOS, a list of drive letters is (eventually) returned. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2321 |
On VMS, a list of volumes is (eventually) returned." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2322 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2323 |
"/ |
4146 | 2324 |
"/ default: return an array filled with |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2325 |
"/ root, home and current directories. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2326 |
"/ |
8669 | 2327 |
^ Array |
7711 | 2328 |
with:'/' |
2329 |
with:(self getHomeDirectory) |
|
2330 |
with:(Filename currentDirectory pathName) |
|
4146 | 2331 |
|
2332 |
"Modified: / 5.5.1999 / 01:06:26 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2333 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2334 |
|
4852 | 2335 |
getMountedVolumes |
8669 | 2336 |
"return info about mounted volumes. |
4852 | 2337 |
The amount of information returned depends upon the OS, and is |
2338 |
not guaranteed to be consistent across architectures. |
|
2339 |
On unix, the information returned is (at least): |
|
7711 | 2340 |
mountPoint - mount point |
2341 |
fileSystem - device or NFS-remotePath |
|
4852 | 2342 |
" |
2343 |
||
2344 |
^ #() |
|
2345 |
||
2346 |
" |
|
2347 |
OperatingSystem getMountedVolumes |
|
2348 |
" |
|
2349 |
||
2350 |
"Modified: / 22.5.1999 / 00:36:06 / cg" |
|
2351 |
! |
|
2352 |
||
4200 | 2353 |
getNullDevice |
2354 |
"get the name of the null-device. Nil is returned if not supported" |
|
2355 |
||
2356 |
^ nil |
|
2357 |
||
2358 |
"Created: / 19.5.1999 / 12:24:59 / cg" |
|
2359 |
! |
|
2360 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2361 |
idOf:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2362 |
"return the fileNumber (i.e. inode number) of a file. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2363 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2364 |
Not all operatingSystems may provide this - on those that do not, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2365 |
some dummy id will be returned. |
8669 | 2366 |
On unix, this information can be used to check for two files being |
2367 |
physically identical, even if found in different directories |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2368 |
(i.e. if they are hardLinked)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2369 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2370 |
|i id| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2371 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2372 |
id := self primIdOf:aPathName. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2373 |
id notNil ifTrue:[^ id]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2374 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2375 |
i := self infoOf:aPathName. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2376 |
i notNil ifTrue:[^ i id]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2377 |
^ nil. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2378 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2379 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2380 |
OperatingSystem idOf:'/' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2381 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2382 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2383 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2384 |
infoOf:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2385 |
"return some object filled with info for the file 'aPathName'; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2386 |
the info (for which corresponding access methods are understood by |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2387 |
the returned object) is: |
7711 | 2388 |
type - a symbol giving the files type |
8669 | 2389 |
mode - numeric access mode |
7711 | 2390 |
uid - owners user id |
2391 |
gid - owners group id |
|
2392 |
size - files size |
|
2393 |
id - files number (i.e. inode number) |
|
2394 |
accessed - last access time (as Timestamp) |
|
2395 |
modified - last modification time (as Timestamp) |
|
2396 |
statusChanged - last status change time (as Timestamp) |
|
2397 |
alternativeName - (windows only: the MSDOS name of the file) |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2398 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2399 |
Some of the fields may be returned as nil on systems which do not provide |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2400 |
all of the information. |
8669 | 2401 |
Return nil if such a file does not exist. |
2402 |
For symbolic links (if supported by the OS), |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2403 |
the info of the pointed-to-file (i.e. the target) is returned; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2404 |
use #linkInfoOf: to get info about the link itself. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2405 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2406 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2407 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2408 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2409 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2410 |
isDirectory:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2411 |
"return true, if 'aPathName' is a valid directory path name. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2412 |
(i.e. exists and is a directory). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2413 |
This also returns true for symbolic links pointing to a directory; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2414 |
if you need to check for this, use #linkInfo:." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2415 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2416 |
^ (self infoOf:aPathName) type == #directory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2417 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2418 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2419 |
isExecutable:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2420 |
"return true, if the given file is executable. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2421 |
For symbolic links, the pointed-to-file is checked." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2422 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2423 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2424 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2425 |
|
6772 | 2426 |
isMountPoint:aPathName |
6781 | 2427 |
"return true, if the given file is a mounted fileSystems mountPoint" |
2428 |
||
2429 |
^ self mountPoints contains:[:mountInfo | mountInfo mountPointPath = aPathName]. |
|
2430 |
||
2431 |
" |
|
8669 | 2432 |
OperatingSystem isMountPoint:'/phys/qnx' |
2433 |
OperatingSystem isMountPoint:'/proc' |
|
2434 |
OperatingSystem isMountPoint:'/' |
|
6781 | 2435 |
" |
6772 | 2436 |
! |
2437 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2438 |
isReadable:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2439 |
"return true, if the file/dir 'aPathName' is readable. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2440 |
For symbolic links, the pointed-to-file is checked." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2441 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2442 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2443 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2444 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2445 |
isSymbolicLink:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2446 |
"return true, if the given file is a symbolic link" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2447 |
|
8474
f06681e84c85
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
8468
diff
changeset
|
2448 |
|info| |
f06681e84c85
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
8468
diff
changeset
|
2449 |
|
f06681e84c85
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
8468
diff
changeset
|
2450 |
info := self linkInfoOf:aPathName. |
f06681e84c85
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
8468
diff
changeset
|
2451 |
^ info notNil and:[info isSymbolicLink] |
f06681e84c85
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
8468
diff
changeset
|
2452 |
|
f06681e84c85
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
8468
diff
changeset
|
2453 |
" |
f06681e84c85
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
8468
diff
changeset
|
2454 |
OperatingSystem isSymbolicLink:'Makefile' |
f06681e84c85
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
8468
diff
changeset
|
2455 |
OperatingSystem isSymbolicLink:'/usr/tmp' |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2456 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2457 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2458 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2459 |
isValidPath:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2460 |
"return true, if 'aPathName' is a valid path name |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2461 |
(i.e. the file or directory exists)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2462 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2463 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2464 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2465 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2466 |
isWritable:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2467 |
"return true, if the given file is writable. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2468 |
For symbolic links, the pointed-to-file is checked." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2469 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2470 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2471 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2472 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2473 |
linkInfoOf:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2474 |
"return a dictionary filled with info for the file 'aPathName', |
8669 | 2475 |
IFF aPathName is a symbolic link. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2476 |
If aPathName is invalid, or its NOT a symbolic link, nil is returned. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2477 |
(which means, that systems like VMS or MSDOS always return nil here.) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2478 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2479 |
The contents of the dictionary gives info about the link itself, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2480 |
on contrast to #infoOf:, which returns the info of the pointed to file |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2481 |
in case of a symbolic link." |
8669 | 2482 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2483 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2484 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2485 |
|
5031 | 2486 |
mimeTypeForFilename:aFilename |
2487 |
"given a filename, return a corresponding mimeType. |
|
2488 |
This is placed here, to allow for OS-specific configuration |
|
2489 |
files and/or the win32 registry to be consultet. |
|
2490 |
Returns nil if no mimeType for the given name is known." |
|
2491 |
||
2492 |
^ nil |
|
2493 |
! |
|
2494 |
||
4240
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2495 |
mimeTypeForSuffix:aFileSuffix |
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2496 |
"given a file suffix, return a corresponding mimeType. |
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2497 |
This is placed here, to allow for OS-specific configuration |
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2498 |
files and/or the win32 registry to be consultet. |
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2499 |
Returns nil if no mimeType for the given suffix is known." |
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2500 |
|
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2501 |
^ nil |
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2502 |
! |
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2503 |
|
6781 | 2504 |
mountPoints |
2505 |
"return a collection of mountPoints (aka. topDirectories of mounted file systems)" |
|
2506 |
||
2507 |
^ #() "/ dont know here |
|
2508 |
! |
|
2509 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2510 |
parentDirectoryName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2511 |
"return the name used to refer to parent directories. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2512 |
In MSDOS, Unix and other systems this is '..', but maybe different |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2513 |
for other systems. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2514 |
(but those are currently not supported - so this is some |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2515 |
preparation for the future)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2516 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2517 |
^ '..' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2518 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2519 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2520 |
pathNameOf:pathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2521 |
"return the pathName of the argument, aPathString, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2522 |
- thats the full pathname of the directory, starting at '/'. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2523 |
This method needs the path to be valid |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2524 |
(i.e. all directories must exist, be readable and executable). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2525 |
Notice: if symbolic links are involved, the result may look different |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2526 |
from what you expect." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2527 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2528 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2529 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2530 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2531 |
primIdOf:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2532 |
"the actual code to return the fileNumber (i.e. inode number) of a file." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2533 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2534 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2535 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2536 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2537 |
primPathNameOf:pathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2538 |
"return the pathName of the argument, aPathString, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2539 |
- thats the full pathname of the directory, starting at '/'. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2540 |
This method here returns nil, if the OS does not provide a |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2541 |
realPath library function. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2542 |
Notice: if symbolic links are involved, the result may look different |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2543 |
from what you expect." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2544 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2545 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2546 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2547 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2548 |
timeOfLastAccess:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2549 |
"return the time, when the file was last accessed. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2550 |
For nonexistent files, nil is returned." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2551 |
|
8669 | 2552 |
^ (self infoOf:aPathName) accessTime |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2553 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2554 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2555 |
timeOfLastChange:aPathName |
8669 | 2556 |
"return the time, when the file was last changed. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2557 |
For nonexistent files, nil is returned." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2558 |
|
6793
0d3e3fd18a70
modified -> modificationTime
Claus Gittinger <cg@exept.de>
parents:
6781
diff
changeset
|
2559 |
^ (self infoOf:aPathName) modificationTime |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2560 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2561 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2562 |
typeOf:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2563 |
"return the type of a file as a symbol; for nonexistent files, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2564 |
nil is returned. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2565 |
Notice: for symbolic links, the type of the pointed-to file is returned." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2566 |
|
8669 | 2567 |
^ (self infoOf:aPathName) type |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2568 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2569 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2570 |
volumeNameOf:aPathString |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2571 |
"return the volumeName of the argument, aPath |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2572 |
- thats the name of the volume where aPath is. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2573 |
Not all OperatingSystems support/use volumes; on unix, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2574 |
this always returns an empty string." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2575 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2576 |
^ '' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2577 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2578 |
|
4200 | 2579 |
!AbstractOperatingSystem class methodsFor:'interprocess communication'! |
2580 |
||
2581 |
createCOMFileForVMSCommand:aCommandString in:aDirectory |
|
4204 | 2582 |
"this is only implemented/required for VMS systems, to execute commands" |
2583 |
||
2584 |
^ UnsupportedOperationSignal raise |
|
2585 |
||
4200 | 2586 |
"Created: / 19.5.1999 / 12:16:31 / cg" |
4204 | 2587 |
"Modified: / 19.5.1999 / 14:22:05 / cg" |
4200 | 2588 |
! |
2589 |
||
2590 |
createMailBox |
|
4204 | 2591 |
"this is only implemented/required for VMS systems, to emulate pipes" |
2592 |
||
2593 |
^ UnsupportedOperationSignal raise |
|
4200 | 2594 |
|
2595 |
"Created: / 19.5.1999 / 12:14:56 / cg" |
|
4204 | 2596 |
"Modified: / 19.5.1999 / 14:22:22 / cg" |
4200 | 2597 |
! |
2598 |
||
2599 |
destroyMailBox:mbx |
|
4204 | 2600 |
"this is only implemented/required for VMS systems, to emulate pipes" |
2601 |
||
2602 |
^ UnsupportedOperationSignal raise |
|
2603 |
||
4200 | 2604 |
"Created: / 19.5.1999 / 12:16:43 / cg" |
4204 | 2605 |
"Modified: / 19.5.1999 / 14:22:33 / cg" |
4200 | 2606 |
! |
2607 |
||
2608 |
mailBoxNameOf:mbx |
|
4204 | 2609 |
"this is only implemented/required for VMS systems, to emulate pipes" |
2610 |
||
2611 |
^ UnsupportedOperationSignal raise |
|
4200 | 2612 |
|
2613 |
"Created: / 19.5.1999 / 12:14:56 / cg" |
|
4204 | 2614 |
"Modified: / 19.5.1999 / 14:22:40 / cg" |
4200 | 2615 |
! |
2616 |
||
8967
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2617 |
makeBidirectionalPipe |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2618 |
"answer an array with 2 filedescriptors representing |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2619 |
the two ends of a bidirectional pipe - see also #makePipe" |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2620 |
|
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2621 |
^ self subclassResponsibility |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2622 |
! |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2623 |
|
4200 | 2624 |
makePipe |
8967
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2625 |
"answer an array with 2 filedescriptors representing |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2626 |
the two ends of a unidirectional pipe- see also #makeSocketPair" |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2627 |
|
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2628 |
^ self subclassResponsibility |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2629 |
! |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2630 |
|
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2631 |
shutdownBidirectionalPipeOutput:fileDescriptor |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2632 |
"inform the other end of the bidirectional pipe represented by fileDescriptor, that |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2633 |
we will send no more data to the pipe, i.e. EOF is reached" |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2634 |
|
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2635 |
^ self subclassResponsibility |
4200 | 2636 |
! ! |
2637 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2638 |
!AbstractOperatingSystem class methodsFor:'interrupts & signals'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2639 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2640 |
blockInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2641 |
"disable interrupt processing - if disabled, incoming |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2642 |
interrupts will be registered and handled as soon as |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2643 |
interrupts are reenabled by OperatingSystemclass>>unblockInterrupts. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2644 |
Returns the previous blocking status i.e. true if interrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2645 |
where already blocked. You need this information for proper |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2646 |
unblocking, in case of nested block/unblock calls." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2647 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2648 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2649 |
RETURN ( __BLOCKINTERRUPTS() ); |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2650 |
%} |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2651 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2652 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2653 |
defaultSignal:signalNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2654 |
"revert to the default action on arrival of a (Unix-)signal. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2655 |
Dont confuse Unix signals with smalltalk signals. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2656 |
WARNING: for some signals, it is no good idea to revert to default; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2657 |
for example, the default for SIGINT (i.e. ^C) is to exit; while the |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2658 |
default for SIGQUIT (^ \) is to dump core. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2659 |
Also, NOTICE that signal numbers are not portable between unix |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2660 |
systems - use OperatingSystem sigXXX to get the numeric value for |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2661 |
a signal." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2662 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2663 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2664 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2665 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2666 |
disableChildSignalInterrupts |
8669 | 2667 |
"disable childSignal interrupts |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2668 |
(SIGCHLD, if the architecture supports it). |
8669 | 2669 |
We have to set the signal back to default, because ignoring |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2670 |
SIGCHLD breaks wait & co" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2671 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2672 |
^ self defaultSignal:(self sigCHLD) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2673 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2674 |
"Created: 5.1.1996 / 15:45:28 / stefan" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2675 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2676 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2677 |
disableIOInterruptsOn:fd |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2678 |
"turn off IO interrupts for a filedescriptor" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2679 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2680 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2681 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2682 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2683 |
disableSignal:signalNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2684 |
"disable (Unix-) signal processing for signalNumber. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2685 |
Dont confuse Unix signals with smalltalk signals. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2686 |
WARNING: for some signals, it is no good idea to disable |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2687 |
them; for example, disabling the SIGINT signal turns off ^C |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2688 |
handling. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2689 |
Also, NOTICE that signal numbers are not portable between unix |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2690 |
systems - use OperatingSystem sigXXX to get the numeric value for |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2691 |
a signal. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2692 |
Use only for fully debugged stand alone applications." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2693 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2694 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2695 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2696 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2697 |
disableTimer |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2698 |
"disable timer interrupts. |
8669 | 2699 |
WARNING: |
7711 | 2700 |
the system will not operate correctly with timer interrupts |
2701 |
disabled, because no scheduling or timeouts are possible." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2702 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2703 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2704 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2705 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2706 |
disableUserInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2707 |
"disable userInterrupt processing; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2708 |
when disabled, no ^C processing takes place. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2709 |
WARNING: |
7711 | 2710 |
If at all, use this only for debugged stand-alone applications, since |
2711 |
no exit to the debugger is possible with user interrupts disabled. |
|
2712 |
We recommend setting up a handler for the signal instead of disabling it." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2713 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2714 |
self disableSignal:(self sigBREAK). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2715 |
self disableSignal:(self sigINT). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2716 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2717 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2718 |
enableAbortInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2719 |
"enable abort signalhandling, and make it a regular signalInterrupt. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2720 |
(the default will dump core and exit - which is not a good idea for |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2721 |
end-user applications ...). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2722 |
This is especially useful, if linked-in C-libraries call abort() ..." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2723 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2724 |
self enableSignal:(self sigABRT) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2725 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2726 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2727 |
enableChildSignalInterrupts |
8669 | 2728 |
"enable childSignal interrupts |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2729 |
(SIGCHLD, if the architecture supports it). |
8669 | 2730 |
After enabling, these signals will send the message |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2731 |
'childSignalInterrupt' to the ChildSignalInterruptHandler object." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2732 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2733 |
self enableSignal:(self sigCHLD) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2734 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2735 |
|
6389 | 2736 |
enableCrashSignalInterrupts |
2737 |
"enable powerFail signal exception interrupts (sigPWR). |
|
2738 |
After enabling, this signal will trigger the writing of a crash-image" |
|
2739 |
||
2740 |
self enableSignal:(self sigPWR). |
|
2741 |
self enableSignal:(self sigHUP) |
|
2742 |
! |
|
2743 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2744 |
enableFpExceptionInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2745 |
"enable floating point exception interrupts (if the |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2746 |
architecture supports it). |
8669 | 2747 |
After enabling, fpu-exceptions will send the message |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2748 |
'fpuExceptionInterrupt' to the FPUExceptionInterruptHandler object." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2749 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2750 |
self enableSignal:(self sigFP) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2751 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2752 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2753 |
enableHardSignalInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2754 |
"enable hard signal exception interrupts (trap, buserror & segm. violation). |
8669 | 2755 |
After enabling, these exceptions will send the message |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2756 |
'signalInterrupt' to the SignalInterruptHandler object." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2757 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2758 |
"/ leads to trouble ... |
6389 | 2759 |
"/ self enableSignal:(self sigPIPE). |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2760 |
"/ ... better to ignore them, and let it be handled as a writeErrorSignal. |
6389 | 2761 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2762 |
self disableSignal:(self sigPIPE). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2763 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2764 |
self enableSignal:(self sigILL). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2765 |
self enableSignal:(self sigBUS). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2766 |
self enableSignal:(self sigSEGV). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2767 |
self enableSignal:(self sigFP). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2768 |
self enableSignal:(self sigEMT). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2769 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2770 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2771 |
enableIOInterruptsOn:fd |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2772 |
"turn on IO interrupts for a filedescriptor" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2773 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2774 |
self subclassResonsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2775 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2776 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2777 |
enableQuitInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2778 |
"enable quitInterrupt (usually ^\) handling, and make it a userInterrupt. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2779 |
(the default will dump core and exit - which is not a good idea for |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2780 |
end-user applications ...)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2781 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2782 |
self enableSignal:(self sigQUIT) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2783 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2784 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2785 |
enableSignal:signalNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2786 |
"enable (Unix-)signal processing for signalNumber. |
8587 | 2787 |
Don't confuse Unix signals with smalltalk signals. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2788 |
The signal will be delivered to one of the standard handlers |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2789 |
(SIGINT, SIGQUIT, etc) or to a general handler, which |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2790 |
sends #signalInterrupt:. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2791 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2792 |
NOTICE that signal numbers are not portable between unix |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2793 |
systems - use OperatingSystem sigXXX to get the numeric value for |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2794 |
a signal." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2795 |
|
8587 | 2796 |
self subclassResponsibility |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2797 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2798 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2799 |
enableTimer:milliSeconds |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2800 |
"setup for a timerInterrupt, to be signalled after some (real) time." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2801 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2802 |
self subclassResonsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2803 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2804 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2805 |
enableUserInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2806 |
"enable userInterrupt (^C) handling; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2807 |
when enabled, ^C in the terminal window will send the message |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2808 |
'userInterrupt' to the UserInterruptHandler object." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2809 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2810 |
self enableSignal:(self sigINT). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2811 |
self enableSignal:(self sigBREAK). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2812 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2813 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2814 |
interruptPending |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2815 |
"return true, if an interrupt is pending. The returned value is |
8669 | 2816 |
invalid if interrupts are not currently blocked, since otherwise |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2817 |
the interrupt is usually already handled before arriving here, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2818 |
or may be served while returning from here." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2819 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2820 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2821 |
extern OBJ __INTERRUPTPENDING(); |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2822 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2823 |
RETURN ( __INTERRUPTPENDING() ); |
8669 | 2824 |
%} |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2825 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2826 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2827 |
interruptsBlocked |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2828 |
"return true, if interrupt handling is currently disabled; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2829 |
false otherwise." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2830 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2831 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2832 |
extern OBJ __INTERRUPTS_BLOCKED(); |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2833 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2834 |
RETURN ( __INTERRUPTS_BLOCKED() ); |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2835 |
%} |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2836 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2837 |
|
6536 | 2838 |
isFatalSignal:aNumber |
2839 |
"return true if a signal with number aNumber is a fatal signal, |
|
2840 |
i.e. some severe internal error occured" |
|
2841 |
||
2842 |
^ self subclassResponsibility |
|
2843 |
! |
|
2844 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2845 |
killProcess:processId |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2846 |
"kill an OS process. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2847 |
The process has a no chance to do some cleanup. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2848 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2849 |
WARNING: in order to avoid zombie processes (on unix), |
7711 | 2850 |
you may have to fetch the processes exitstatus with |
2851 |
OperatingSystem>>getStatusOfProcess:aProcessId." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2852 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2853 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2854 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2855 |
"Modified: / 10.6.1998 / 12:00:07 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2856 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2857 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2858 |
killProcessGroup:processGroupId |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2859 |
"kill an OS process group. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2860 |
The process has NO chance to do some cleanup. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2861 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2862 |
WARNING: in order to avoid zombie processes (on unix), |
7711 | 2863 |
you may have to fetch the processes exitstatus with |
2864 |
OperatingSystem>>getStatusOfProcess:aProcessId." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2865 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2866 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2867 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2868 |
"Created: / 10.6.1998 / 12:00:26 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2869 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2870 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2871 |
nameForSignal:aSignalNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2872 |
"for a given Unix signalnumber, return a descriptive string" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2873 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2874 |
aSignalNumber == self sigHUP ifTrue:[^ 'hangup']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2875 |
aSignalNumber == self sigINT ifTrue:[^ 'interrupt']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2876 |
aSignalNumber == self sigKILL ifTrue:[^ 'kill']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2877 |
aSignalNumber == self sigQUIT ifTrue:[^ 'quit']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2878 |
aSignalNumber == self sigILL ifTrue:[^ 'illegal instruction']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2879 |
aSignalNumber == self sigTRAP ifTrue:[^ 'trap']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2880 |
aSignalNumber == self sigABRT ifTrue:[^ 'abort']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2881 |
aSignalNumber == self sigIOT ifTrue:[^ 'iot trap']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2882 |
aSignalNumber == self sigEMT ifTrue:[^ 'emt trap']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2883 |
aSignalNumber == self sigFP ifTrue:[^ 'fp exception']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2884 |
aSignalNumber == self sigBUS ifTrue:[^ 'bus error']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2885 |
aSignalNumber == self sigSEGV ifTrue:[^ 'segmentation violation']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2886 |
aSignalNumber == self sigSYS ifTrue:[^ 'bad system call']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2887 |
aSignalNumber == self sigPIPE ifTrue:[^ 'broken pipe']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2888 |
aSignalNumber == self sigALRM ifTrue:[^ 'alarm timer']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2889 |
aSignalNumber == self sigTERM ifTrue:[^ 'termination']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2890 |
aSignalNumber == self sigSTOP ifTrue:[^ 'stop']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2891 |
aSignalNumber == self sigTSTP ifTrue:[^ 'tty stop']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2892 |
aSignalNumber == self sigCONT ifTrue:[^ 'continue']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2893 |
aSignalNumber == self sigCHLD ifTrue:[^ 'child death']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2894 |
aSignalNumber == self sigTTIN ifTrue:[^ 'background tty input']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2895 |
aSignalNumber == self sigTTOU ifTrue:[^ 'background tty output']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2896 |
aSignalNumber == self sigIO ifTrue:[^ 'io available']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2897 |
aSignalNumber == self sigXCPU ifTrue:[^ 'cpu time expired']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2898 |
aSignalNumber == self sigXFSZ ifTrue:[^ 'file size limit']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2899 |
aSignalNumber == self sigVTALRM ifTrue:[^ 'virtual alarm timer']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2900 |
aSignalNumber == self sigPROF ifTrue:[^ 'profiling timer']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2901 |
aSignalNumber == self sigWINCH ifTrue:[^ 'winsize changed']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2902 |
aSignalNumber == self sigLOST ifTrue:[^ 'resource lost']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2903 |
aSignalNumber == self sigUSR1 ifTrue:[^ 'user signal 1']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2904 |
aSignalNumber == self sigUSR2 ifTrue:[^ 'user signal 2']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2905 |
aSignalNumber == self sigMSG ifTrue:[^ 'HFT message']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2906 |
aSignalNumber == self sigPWR ifTrue:[^ 'power-fail']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2907 |
aSignalNumber == self sigPRE ifTrue:[^ 'programming exception']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2908 |
aSignalNumber == self sigGRANT ifTrue:[^ 'HFT access wanted']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2909 |
aSignalNumber == self sigRETRACT ifTrue:[^ 'HFT access relinquish']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2910 |
aSignalNumber == self sigSOUND ifTrue:[^ 'HFT sound complete']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2911 |
aSignalNumber == self sigDANGER ifTrue:[^ 'low on paging space']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2912 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2913 |
"notice: many systems map SIGPOLL and/or SIGUSR onto SIGIO |
8669 | 2914 |
therefore, keep SIGIO always above the two below" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2915 |
aSignalNumber == self sigPOLL ifTrue:[^ 'io available']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2916 |
aSignalNumber == self sigURG ifTrue:[^ 'urgent']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2917 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2918 |
^ 'unknown signal' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2919 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2920 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2921 |
OperatingSystem nameForSignal:9 |
8669 | 2922 |
OperatingSystem nameForSignal:(OperatingSystem sigPOLL) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2923 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2924 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2925 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2926 |
operatingSystemSignal:signalNumber |
8669 | 2927 |
"return the signal to be raised when an |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2928 |
operatingSystem-signal occurs, or nil" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2929 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2930 |
OSSignals notNil ifTrue:[ |
7711 | 2931 |
^ OSSignals at:signalNumber ifAbsent:[nil] |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2932 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2933 |
^ nil |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2934 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2935 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2936 |
operatingSystemSignal:signalNumber install:aSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2937 |
"install a signal to be raised when an operatingSystem-signal occurs" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2938 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2939 |
OSSignals isNil ifTrue:[ |
7711 | 2940 |
OSSignals := Array new:32 |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2941 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2942 |
OSSignals at:signalNumber put:aSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2943 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2944 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2945 |
sendSignal:signalNumber to:processId |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2946 |
"send a unix signal to some process (maybe myself). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2947 |
Returns false if any error occurred, true otherwise. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2948 |
|
8587 | 2949 |
Do not confuse UNIX signals with Smalltalk-Signals." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2950 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2951 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2952 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2953 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2954 |
startSpyTimer |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2955 |
"trigger a spyInterrupt, to be signalled after some short (virtual) time. |
4200 | 2956 |
Return true, if the spy-timerInterrupt was enabled. |
2957 |
This was used by the old MessageTally for profiling. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2958 |
On systems, where no virtual timer is available, use the real timer |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2959 |
(which is of course less correct). |
8669 | 2960 |
OBSOLETE: the new messageTally runs as a high prio process, not using |
7711 | 2961 |
spy interrupts." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2962 |
|
4200 | 2963 |
^ false |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2964 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2965 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2966 |
stopSpyTimer |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2967 |
"stop spy timing - disable spy timer. |
8669 | 2968 |
OBSOLETE: the new messageTally runs as a high prio process, not using |
7711 | 2969 |
spy interrupts." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2970 |
|
4200 | 2971 |
^ false |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2972 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2973 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2974 |
terminateProcess:processId |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2975 |
"terminate a unix process. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2976 |
The process has a chance to do some cleanup. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2977 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2978 |
WARNING: in order to avoid zombie processes (on unix), |
7711 | 2979 |
you may have to fetch the processes exitstatus with |
2980 |
OperatingSystem>>getStatusOfProcess:aProcessId." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2981 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2982 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2983 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2984 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2985 |
terminateProcessGroup:processGroupId |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2986 |
"terminate a unix process group. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2987 |
The process has a chance to do some cleanup. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2988 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2989 |
WARNING: in order to avoid zombie processes (on unix), |
7711 | 2990 |
you may have to fetch the processes exitstatus with |
2991 |
OperatingSystem>>getStatusOfProcess:aProcessId." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2992 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2993 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2994 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2995 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2996 |
unblockInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2997 |
"enable interrupt processing - if any interrupts are pending, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2998 |
these will be handled immediately. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2999 |
When unblocking interrupts, take care of nested block/unblock |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3000 |
calls - you must only unblock after a blockcall if they where |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3001 |
really not blocked before. See OperatingSystemclass>>blockInterrupts." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3002 |
%{ |
8505
4456ffd20005
#unblockInterrupts returns the prvious blocking state
Stefan Vogel <sv@exept.de>
parents:
8497
diff
changeset
|
3003 |
RETURN(__UNBLOCKINTERRUPTS()); |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3004 |
%} |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3005 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3006 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3007 |
!AbstractOperatingSystem class methodsFor:'misc'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3008 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3009 |
closePid:pid |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3010 |
"free pid resource" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3011 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3012 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3013 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3014 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3015 |
exit |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3016 |
"shutdown smalltalk immediately - this method does not return. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3017 |
Return 'good'-status (0) to the parent unix process." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3018 |
|
5429 | 3019 |
self exit:0. |
3020 |
||
8804 | 3021 |
"OperatingSystem exit - don't evaluate this" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3022 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3023 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3024 |
exit:exitCode |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3025 |
"shutdown smalltalk immediately - |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3026 |
returning an exit-code to the parent unix process." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3027 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3028 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3029 |
int code = 1; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3030 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3031 |
if (__isSmallInteger(exitCode)) { |
8804 | 3032 |
code = __intVal(exitCode); |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3033 |
} |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3034 |
__mainExit(code); |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3035 |
%} |
8804 | 3036 |
"OperatingSystem exit:1 - don't evaluate this" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3037 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3038 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3039 |
exitWithCoreDump |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3040 |
"shutdown smalltalk immediately - dumping core. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3041 |
This always returns 'bad'-status to the parent unix process. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3042 |
Notice, that no cleanup is performed at all - you may have to |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3043 |
manually remove any tempfiles. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3044 |
Use this only for debugging ST/X itself" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3045 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3046 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3047 |
abort(); |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3048 |
%} |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3049 |
" |
8804 | 3050 |
OperatingSystem exitWithCoreDump - don't evaluate this |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3051 |
" |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3052 |
! |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3053 |
|
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3054 |
getVMSSymbol:aSymbolString |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3055 |
"get a symbols value, or nil if there is none" |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3056 |
|
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3057 |
^ nil |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3058 |
|
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3059 |
"Created: / 5.6.1998 / 19:02:50 / cg" |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3060 |
"Modified: / 5.6.1998 / 19:03:15 / cg" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3061 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3062 |
|
7289
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3063 |
!AbstractOperatingSystem class methodsFor:'obsolete'! |
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3064 |
|
8236 | 3065 |
baseNameOf:aPath |
3066 |
<resource:#obsolete> |
|
3067 |
||
3068 |
self obsoleteMethodWarning:'use asFilename baseName'. |
|
3069 |
^ aPath asFilename baseName |
|
7289
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3070 |
! ! |
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3071 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3072 |
!AbstractOperatingSystem class methodsFor:'os queries'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3073 |
|
3806 | 3074 |
getCCDefine |
3075 |
"return a string which was used to identify the C-Compiler used |
|
3076 |
when STX was compiled, and which should be passed down when compiling methods. |
|
8669 | 3077 |
For example, on linux, this is '__GNUC__'; |
3806 | 3078 |
on windows, this is either '__MSC__' or '__BORLANDC__'" |
3079 |
||
3080 |
%{ /* NOCONTEXT */ |
|
3081 |
#ifndef CC_DEFINE |
|
3082 |
# ifdef WIN32 |
|
3083 |
# ifdef __BORLANDC__ |
|
3829 | 3084 |
# define CC_DEFINE "__BORLANDC__" |
3806 | 3085 |
# else |
3086 |
# define CC_DEFINE "__MSC__" |
|
3087 |
# endif |
|
3088 |
# else |
|
3089 |
# ifdef __GNUC__ |
|
3090 |
# define CC_DEFINE "__GNUC__" |
|
3091 |
# else |
|
3092 |
# define CC_DEFINE "__CC__" |
|
3093 |
# endif |
|
3094 |
# endif |
|
3095 |
#endif |
|
3096 |
RETURN ( __MKSTRING(CC_DEFINE)); |
|
3097 |
%} |
|
3098 |
" |
|
3099 |
OperatingSystem getCCDefine |
|
3100 |
" |
|
3101 |
! |
|
3102 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3103 |
getCPUDefine |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3104 |
"return a string which was used to identify this CPU type when STX was |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3105 |
compiled, and which should be passed down when compiling methods. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3106 |
For example, on linux, this may be '-Di386'; on a vax, this would be '-Dvax'. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3107 |
This is normally not of interest to 'normal' users; however, it is passed |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3108 |
down to the c-compiler when methods are incrementally compiled to machine code." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3109 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3110 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3111 |
# ifndef CPU_DEFINE |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3112 |
# define CPU_DEFINE "-DunknownCPU" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3113 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3114 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3115 |
RETURN ( __MKSTRING(CPU_DEFINE)); |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3116 |
%} |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3117 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3118 |
OperatingSystem getCPUDefine |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3119 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3120 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3121 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3122 |
getCPUType |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3123 |
"return a string giving the type of machine we're running on. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3124 |
Here, the machine for which ST/X was compiled is returned |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3125 |
(i.e. for all x86's, the same i386 is returned). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3126 |
This may normally not be of any interest to you ..." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3127 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3128 |
|cpu| |
8669 | 3129 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3130 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3131 |
|
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3132 |
# ifdef __vax__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3133 |
# define CPU_SYMBOL @symbol(vax) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3134 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3135 |
# ifdef __mips__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3136 |
# define CPU_SYMBOL @symbol(mips) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3137 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3138 |
# ifdef __i386__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3139 |
# define CPU_SYMBOL @symbol(i386) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3140 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3141 |
# ifdef __i860__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3142 |
# define CPU_SYMBOL @symbol(i860) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3143 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3144 |
# ifdef __ns32k__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3145 |
# define CPU_SYMBOL @symbol(ns32k) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3146 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3147 |
# ifdef __mc68k__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3148 |
# define CPU_SYMBOL @symbol(mc68k) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3149 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3150 |
# ifdef __mc88k__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3151 |
# define CPU_SYMBOL @symbol(mc88k) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3152 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3153 |
# ifdef __sparc__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3154 |
# define CPU_SYMBOL @symbol(sparc) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3155 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3156 |
# ifdef __hppa__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3157 |
# define CPU_SYMBOL @symbol(hppa) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3158 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3159 |
# ifdef __rs6000__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3160 |
# define CPU_SYMBOL @symbol(rs6000) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3161 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3162 |
# ifdef __powerPC__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3163 |
# define CPU_SYMBOL @symbol(powerPC) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3164 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3165 |
# ifdef __alpha__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3166 |
# define CPU_SYMBOL @symbol(alpha) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3167 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3168 |
# ifdef __transputer__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3169 |
# define CPU_SYMBOL @symbol(transputer) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3170 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3171 |
# ifdef __ibm370__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3172 |
# define CPU_SYMBOL @symbol(ibm370) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3173 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3174 |
# ifdef __s390__ |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3175 |
# define CPU_SYMBOL @symbol(s390) |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3176 |
# endif |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3177 |
# ifdef __arm__ |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3178 |
# define CPU_SYMBOL @symbol(arm) |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3179 |
# endif |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3180 |
# ifdef __ia64__ |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3181 |
# define CPU_SYMBOL @symbol(ia64) |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3182 |
# endif |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3183 |
|
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3184 |
# ifndef CPU_SYMBOL |
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3185 |
# define CPU_SYMBOL @symbol(unknown) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3186 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3187 |
|
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3188 |
cpu = CPU_SYMBOL; |
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3189 |
# undef CPU_SYMBOL |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3190 |
%}. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3191 |
^ cpu |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3192 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3193 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3194 |
OperatingSystem getCPUType |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3195 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3196 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3197 |
"examples: are we running on a ss-10/solaris ?" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3198 |
" |
8669 | 3199 |
(OperatingSystem getCPUType = 'sparc') |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3200 |
and:[OperatingSystem getOSType = 'solaris'] |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3201 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3202 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3203 |
"or on a pc/solaris ?" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3204 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3205 |
(OperatingSystem getCPUType = 'i386') |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3206 |
and:[OperatingSystem getOSType = 'solaris'] |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3207 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3208 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3209 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3210 |
getDomainName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3211 |
"return the domain this host is in. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3212 |
Notice: |
7711 | 3213 |
not all systems support this; on some, 'unknown' is returned." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3214 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3215 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3216 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3217 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3218 |
getEnvironment:aStringOrSymbol |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3219 |
"get an environment string" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3220 |
|
5407 | 3221 |
^ self subclassResponsibility |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3222 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3223 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3224 |
getHostName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3225 |
"return the hostname we are running on - if there is |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3226 |
a HOST environment variable, we are much faster here ... |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3227 |
Notice: |
7711 | 3228 |
not all systems support this; on some, 'unknown' is returned." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3229 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3230 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3231 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3232 |
|
7778
cbbd8c2faccc
Language stuff: define #getLanguage
Stefan Vogel <sv@exept.de>
parents:
7770
diff
changeset
|
3233 |
getLanguage |
cbbd8c2faccc
Language stuff: define #getLanguage
Stefan Vogel <sv@exept.de>
parents:
7770
diff
changeset
|
3234 |
"get the LANGUAGE setting (example: de_DE.iso8859-15@euro)" |
cbbd8c2faccc
Language stuff: define #getLanguage
Stefan Vogel <sv@exept.de>
parents:
7770
diff
changeset
|
3235 |
|
cbbd8c2faccc
Language stuff: define #getLanguage
Stefan Vogel <sv@exept.de>
parents:
7770
diff
changeset
|
3236 |
^ self getEnvironment:'LANG'. |
cbbd8c2faccc
Language stuff: define #getLanguage
Stefan Vogel <sv@exept.de>
parents:
7770
diff
changeset
|
3237 |
! |
cbbd8c2faccc
Language stuff: define #getLanguage
Stefan Vogel <sv@exept.de>
parents:
7770
diff
changeset
|
3238 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3239 |
getLocaleInfo |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3240 |
"return a dictionary filled with values from the locale information; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3241 |
Not all fields may be present, depending on the OS's setup and capabilities. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3242 |
Possible fields are: |
7711 | 3243 |
decimalPoint <String> |
3244 |
||
3245 |
thousandsSep <String> |
|
3246 |
||
3247 |
internationalCurrencySymbol <String> |
|
3248 |
||
3249 |
currencySymbol <String> |
|
3250 |
||
3251 |
monetaryDecimalPoint <String> |
|
3252 |
||
3253 |
monetaryThousandsSeparator <String> |
|
3254 |
||
3255 |
positiveSign <String> |
|
3256 |
||
3257 |
negativeSign <String> |
|
3258 |
||
3259 |
internationalFractionalDigits <Integer> |
|
3260 |
||
3261 |
fractionalDigits <Integer> |
|
3262 |
||
3263 |
positiveSignPrecedesCurrencySymbol <Boolean> |
|
3264 |
||
3265 |
negativeSignPrecedesCurrencySymbol <Boolean> |
|
3266 |
||
3267 |
positiveSignSeparatedBySpaceFromCurrencySymbol <Boolean> |
|
3268 |
||
3269 |
negativeSignSeparatedBySpaceFromCurrencySymbol <Boolean> |
|
3270 |
||
3271 |
positiveSignPosition <Symbol> |
|
8669 | 3272 |
one of: #parenthesesAround, |
3273 |
#signPrecedes, |
|
3274 |
#signSuceeds, |
|
7711 | 3275 |
#signPrecedesCurrencySymbol, |
3276 |
#signSuceedsCurrencySymbol |
|
3277 |
||
3278 |
negativeSignPosition <like above> |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3279 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3280 |
it is up to the application to deal with undefined values. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3281 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3282 |
Notice, that (for now), the system does not use this information; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3283 |
it should be used by applications as required. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3284 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3285 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3286 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3287 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3288 |
|
8997 | 3289 |
getNetworkAddresses |
3290 |
"return a dictionary with key:name of interface and |
|
3291 |
value:the network address for each interface" |
|
3292 |
||
3293 |
self subclassResponsibility |
|
3294 |
! |
|
3295 |
||
7289
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3296 |
getNetworkMACAddresses |
8669 | 3297 |
"return a dictionary with key:name of interface and |
7711 | 3298 |
value:the MAC adress for each interface" |
6363 | 3299 |
|
3300 |
self subclassResponsibility |
|
3301 |
! |
|
3302 |
||
7289
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3303 |
getNetworkMACAddressesForIf:ifName |
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3304 |
"return the MAC adress for interface ifName" |
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3305 |
|
8641
1b45626f0e50
noMacAddress fallBack (NT4.0)
Claus Gittinger <cg@exept.de>
parents:
8587
diff
changeset
|
3306 |
self getNetworkMACAddresses at:ifName ifAbsent:nil |
1b45626f0e50
noMacAddress fallBack (NT4.0)
Claus Gittinger <cg@exept.de>
parents:
8587
diff
changeset
|
3307 |
|
1b45626f0e50
noMacAddress fallBack (NT4.0)
Claus Gittinger <cg@exept.de>
parents:
8587
diff
changeset
|
3308 |
"Modified: / 17-11-2004 / 01:43:35 / cg" |
6363 | 3309 |
! |
3310 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3311 |
getOSDefine |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3312 |
"return a string which was used to identify this machine when stx was |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3313 |
compiled, and which should be passed down when compiling methods. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3314 |
For example, on linux, this is '-DLINUX'." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3315 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3316 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3317 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3318 |
#ifndef OS_DEFINE |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3319 |
# ifdef WIN32 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3320 |
# define OS_DEFINE "-DWIN32" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3321 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3322 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3323 |
# ifndef OS_DEFINE |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3324 |
# define OS_DEFINE "-DunknownOS" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3325 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3326 |
#endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3327 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3328 |
RETURN ( __MKSTRING(OS_DEFINE)); |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3329 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3330 |
#undef OS_DEFINE |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3331 |
%} |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3332 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3333 |
OperatingSystem getOSDefine |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3334 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3335 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3336 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3337 |
getOSType |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3338 |
"return a string giving the type of OS we're running on. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3339 |
This can be used to adapt programs to certain environment |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3340 |
differences (for example: mail-lock strategy ...)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3341 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3342 |
|os| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3343 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3344 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3345 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3346 |
# ifdef MSDOS |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3347 |
# define OS_SYMBOL @symbol(msdos) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3348 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3349 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3350 |
# ifdef WIN32 |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3351 |
# define OS_SYMBOL @symbol(win32) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3352 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3353 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3354 |
# ifdef MSWINDOWS |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3355 |
# define OS_SYMBOL @symbol(mswindows) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3356 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3357 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3358 |
# ifdef VMS |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3359 |
# ifdef __openVMS__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3360 |
# define OS_SYMBOL @symbol(openVMS) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3361 |
# else |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3362 |
# define OS_SYMBOL @symbol(VMS) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3363 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3364 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3365 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3366 |
# ifdef MVS /* ;-) */ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3367 |
# define OS_SYMBOL @symbol(mvs) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3368 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3369 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3370 |
# ifdef OS2 |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3371 |
# define OS_SYMBOL @symbol(os2) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3372 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3373 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3374 |
# ifdef sinix |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3375 |
# define OS_SYMBOL @symbol(sinix) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3376 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3377 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3378 |
# ifdef ultrix |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3379 |
# define OS_SYMBOL @symbol(ultrix) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3380 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3381 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3382 |
# ifdef sco |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3383 |
# define OS_SYMBOL @symbol(sco) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3384 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3385 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3386 |
# ifdef hpux |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3387 |
# define OS_SYMBOL @symbol(hpux) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3388 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3389 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3390 |
# ifdef LINUX |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3391 |
# define OS_SYMBOL @symbol(linux) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3392 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3393 |
|
6651 | 3394 |
# ifdef FREEBSD |
3395 |
# define OS_SYMBOL @symbol(freeBSD) |
|
3396 |
# endif |
|
3397 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3398 |
# ifdef sunos |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3399 |
# define OS_SYMBOL @symbol(sunos) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3400 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3401 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3402 |
# ifdef solaris |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3403 |
# define OS_SYMBOL @symbol(solaris) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3404 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3405 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3406 |
# ifdef IRIS |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3407 |
# define OS_SYMBOL @symbol(irix) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3408 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3409 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3410 |
# ifdef aix |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3411 |
# define OS_SYMBOL @symbol(aix) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3412 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3413 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3414 |
# ifdef realIX |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3415 |
# define OS_SYMBOL @symbol(realIX) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3416 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3417 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3418 |
# ifdef __osf__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3419 |
# define OS_SYMBOL @symbol(osf) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3420 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3421 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3422 |
/* |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3423 |
* no concrete info; become somewhat vague ... |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3424 |
*/ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3425 |
# ifndef OS_SYMBOL |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3426 |
# ifdef MACH |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3427 |
# define OS_SYMBOL @symbol(mach) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3428 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3429 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3430 |
|
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3431 |
# ifndef OS_SYMBOL |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3432 |
# ifdef BSD |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3433 |
# define OS_SYMBOL @symbol(bsd) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3434 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3435 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3436 |
# ifdef SYSV |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3437 |
# ifdef SYSV3 |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3438 |
# define OS_SYMBOL @symbol(sys5_3) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3439 |
# else |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3440 |
# ifdef SYSV4 |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3441 |
# define OS_SYMBOL @symbol(sys5_4) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3442 |
# else |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3443 |
# define OS_SYMBOL @symbol(sys5) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3444 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3445 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3446 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3447 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3448 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3449 |
/* |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3450 |
* become very vague ... |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3451 |
*/ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3452 |
# ifndef OS_SYMBOL |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3453 |
# ifdef POSIX |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3454 |
# define OS_SYMBOL @symbol(posix) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3455 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3456 |
# endif |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3457 |
# ifndef OS_SYMBOL |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3458 |
# ifdef UNIX |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3459 |
# define OS_SYMBOL @symbol(unix) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3460 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3461 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3462 |
|
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3463 |
# ifndef OS_SYMBOL |
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3464 |
# define OS_SYMBOL @symbol(unknown) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3465 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3466 |
|
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3467 |
os = OS_SYMBOL; |
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3468 |
|
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3469 |
# undef OS_SYMBOL |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3470 |
%}. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3471 |
^ os |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3472 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3473 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3474 |
OperatingSystem getOSType |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3475 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3476 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3477 |
|
9698
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3478 |
getPlatformDefine |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3479 |
"return a string which defines the platform, |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3480 |
and which should be passed down when compiling methods. |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3481 |
For example, on all unices, this is '-DUNIX'." |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3482 |
|
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3483 |
%{ /* NOCONTEXT */ |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3484 |
|
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3485 |
#ifndef PLATFORM_DEFINE |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3486 |
# ifdef WIN32 |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3487 |
# define PLATFORM_DEFINE "-DWIN32" |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3488 |
# endif |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3489 |
# ifdef OS2 |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3490 |
# define PLATFORM_DEFINE "-DOS2" |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3491 |
# endif |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3492 |
# ifdef BEOS |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3493 |
# define PLATFORM_DEFINE "-DBEOS" |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3494 |
# endif |
9699 | 3495 |
# ifdef MACOS |
3496 |
# define PLATFORM_DEFINE "-DMACOS" |
|
3497 |
# endif |
|
3498 |
# ifdef VMS |
|
3499 |
# define PLATFORM_DEFINE "-DVMS" |
|
3500 |
# endif |
|
9698
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3501 |
# ifndef PLATFORM_DEFINE |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3502 |
# define PLATFORM_DEFINE "-DUNIX" |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3503 |
# endif |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3504 |
#endif |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3505 |
|
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3506 |
RETURN ( __MKSTRING(PLATFORM_DEFINE)); |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3507 |
%} |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3508 |
" |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3509 |
OperatingSystem getPlatformDefine |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3510 |
" |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3511 |
! |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3512 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3513 |
getProcessId |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3514 |
"return the (unix-)processId" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3515 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3516 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3517 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3518 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3519 |
getSystemID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3520 |
"if supported by the OS, return the systemID; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3521 |
a unique per machine identification. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3522 |
WARNING: |
7711 | 3523 |
not all systems support this; on some, 'unknown' is returned." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3524 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3525 |
^ 'unknown' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3526 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3527 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3528 |
OperatingSystem getSystemID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3529 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3530 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3531 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3532 |
getSystemInfo |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3533 |
"return info on the system weare running on. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3534 |
If the system supports the uname system call, that info is returned; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3535 |
otherwise, some simulated info is returned. |
8669 | 3536 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3537 |
WARNING: |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3538 |
Do not depend on the amount and contents of the returned information, some |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3539 |
systems may return more/less than others. Also, the contents depends on the |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3540 |
OS, for example, linux returns 'ix86', while WIN32 returns 'x86'. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3541 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3542 |
This method is mainly provided to augment error reports with some system |
8669 | 3543 |
information. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3544 |
(in case of system/version specific OS errors, conditional workarounds and patches |
7711 | 3545 |
may be based upon this info). |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3546 |
Your application should NOT depend upon this in any way. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3547 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3548 |
The returned info may (or may not) contain: |
8669 | 3549 |
#system -> some operating system identification (irix, Linux, nt, win32s ...) |
7711 | 3550 |
#version -> OS version (some os version identification) |
3551 |
#release -> OS release (3.5, 1.2.1 ...) |
|
3552 |
#node -> some host identification (hostname) |
|
3553 |
#domain -> domain name (hosts domain) |
|
3554 |
#machine -> type of machine (i586, mips ...) |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3555 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3556 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3557 |
|info| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3558 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3559 |
info := IdentityDictionary new. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3560 |
info at:#system put:(self getSystemType). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3561 |
info at:#node put:(self getHostName). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3562 |
info at:#machine put:(self getCPUType). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3563 |
info at:#architecture put:'unknown'. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3564 |
info at:#domain put:self getDomainName. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3565 |
info at:#osType put:(self getOSType). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3566 |
^ info |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3567 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3568 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3569 |
OperatingSystem getSystemInfo |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3570 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3571 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3572 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3573 |
getSystemType |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3574 |
"return a string giving the type of system we're running on. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3575 |
This is almost the same as getOSType, but the returned string |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3576 |
is slightly different for some systems (i.e. iris vs. irix). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3577 |
Dont depend on this - use getOSType. I dont really see a point |
8669 | 3578 |
here ... |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3579 |
(except for slight differences between next/mach and other machs)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3580 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3581 |
^ self getOSType |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3582 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3583 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3584 |
OperatingSystem getSystemType |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3585 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3586 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3587 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3588 |
getWindowsDirectory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3589 |
"internal interface - only for Windows based systems. |
9699 | 3590 |
Return the windows directory, which, depending on the system, |
3591 |
may be |
|
3592 |
'\WINNT', '\WINDOWS' |
|
3593 |
or whatever. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3594 |
On non-windows systems, nil is returned." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3595 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3596 |
^ nil |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3597 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3598 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3599 |
OperatingSystem getWindowsDirectory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3600 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3601 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3602 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3603 |
getWindowsSystemDirectory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3604 |
"internal interface - only for Windows based systems. |
9699 | 3605 |
Return the windows system directory, which, depending on the system, |
3606 |
may be |
|
3607 |
'\WINNT\SYSTEM32', '\WINDOWS\SYSTEM' |
|
3608 |
or whatever. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3609 |
On non-windows systems, nil is returned." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3610 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3611 |
^ nil |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3612 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3613 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3614 |
OperatingSystem getWindowsSystemDirectory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3615 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3616 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3617 |
|
4207 | 3618 |
hasConsole |
3619 |
"return true, if there is some kind of console available |
|
3620 |
(i.e. for proper stdIn, stdOut and stdErr handling). |
|
5918 | 3621 |
This only returns false when running under windows, and |
4207 | 3622 |
the system is running as a pure windows application. |
3623 |
If false, the miniDebugger is useless and not used." |
|
3624 |
||
3625 |
^ true |
|
3626 |
! |
|
3627 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3628 |
isBSDlike |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3629 |
"return true, if the OS we're running on is a 'real' unix." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3630 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3631 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3632 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3633 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3634 |
isMAClike |
9699 | 3635 |
"return true, if running on a macOS (but not on A/UX or OS/X)" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3636 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3637 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3638 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3639 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3640 |
isMSDOSlike |
9699 | 3641 |
"return true, if the OS we're running on is msdos like (in contrast to unix-like). |
3642 |
This returns true for any of msdos, win32s, win95, winNT and os/2." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3643 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3644 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3645 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3646 |
|
3901 | 3647 |
isMSWINDOWSNTlike |
3648 |
"This returns true if running in a Windows-NT system." |
|
3649 |
||
3650 |
^ false. |
|
3651 |
! |
|
3652 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3653 |
isMSWINDOWSlike |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3654 |
"return true, if running on a MS-Windows like system. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3655 |
This returns true for any of win32s, win95 and winNT." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3656 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3657 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3658 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3659 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3660 |
isOS2like |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3661 |
"return true, if the OS we're running on is OS2 like. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3662 |
Only returns true for a plain OS/2 system." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3663 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3664 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3665 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3666 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3667 |
isUNIXlike |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3668 |
"return true, if the OS we're running on is a unix like." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3669 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3670 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3671 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3672 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3673 |
isVMSlike |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3674 |
"return true, if the OS we're running in is VMS (or openVMS)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3675 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3676 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3677 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3678 |
|
9697 | 3679 |
knownPlatformNames |
3680 |
"return a collection of strings as possibly returned by getPlatformName. |
|
3681 |
Should be used instead of getOSType or getSystemType if multiple choice |
|
3682 |
dialogs are presented to the user." |
|
3683 |
||
3684 |
^#( |
|
3685 |
win32 |
|
3686 |
os2 "/ actually - this is no longer true |
|
9699 | 3687 |
macos "/ actually - this is no longer true |
9697 | 3688 |
vms "/ actually - this is no longer true |
3689 |
beos "/ actually - this was never true |
|
3690 |
unix |
|
3691 |
) |
|
3692 |
||
3693 |
" |
|
3694 |
OperatingSystem knownPlatformNames |
|
3695 |
OperatingSystem platformName |
|
9698
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3696 |
OperatingSystem getPlatformDefine |
9697 | 3697 |
" |
3698 |
||
3699 |
"Modified: 20.6.1997 / 17:37:26 / cg" |
|
3700 |
! |
|
3701 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3702 |
maxFileNameLength |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3703 |
"return the max number of characters in a filename. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3704 |
CAVEAT: |
7711 | 3705 |
Actually, the following is somewhat wrong - some systems |
3706 |
support different sizes, depending on the volume. |
|
3707 |
We return a somewhat conservative number here. |
|
3708 |
Another entry, to query for volume specific max |
|
3709 |
will be added in the future." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3710 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3711 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3712 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3713 |
|
6578 | 3714 |
maxNumberOfOpenFiles |
3715 |
"answer the maximum number of open files for this process" |
|
3716 |
||
3717 |
^ self subclassResponsibility |
|
3718 |
! |
|
3719 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3720 |
maxPathLength |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3721 |
"return the max number of characters in a pathName." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3722 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3723 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3724 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3725 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3726 |
pathSeparator |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3727 |
"return the character which separates items in the PATH variable" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3728 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3729 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3730 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3731 |
|
9700 | 3732 |
platformDefineForPlatformName:osID |
9699 | 3733 |
"return a c-define for a particular platform (use only for makefile generation etc.)" |
3734 |
||
3735 |
osID = 'win32' ifTrue:[ ^ '-DWIN32']. |
|
3736 |
osID = 'os2' ifTrue:[ ^ '-DOS2']. |
|
3737 |
osID = 'macos' ifTrue:[ ^ '-DMACOS']. |
|
3738 |
osID = 'vms' ifTrue:[ ^ '-DVMS']. |
|
3739 |
osID = 'unix' ifTrue:[ ^ '-DUNIX']. |
|
3740 |
self error:'unknown os'. |
|
3741 |
||
3742 |
" |
|
3743 |
OperatingSystem platformDefineForName:(OperatingSystem platformName) |
|
3744 |
" |
|
3745 |
||
3746 |
"Modified: 20.6.1997 / 17:37:26 / cg" |
|
3747 |
! |
|
3748 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3749 |
platformName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3750 |
"return a string describing the OS platform very we're running on. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3751 |
This returns #unix for all unix derivatives. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3752 |
I.e. it is much less specific than getOSType or getSystemType." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3753 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3754 |
|os| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3755 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3756 |
os := self getSystemType. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3757 |
os = 'win32' ifTrue:[ ^ #win32]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3758 |
os = 'os2' ifTrue:[ ^ #os2]. |
9699 | 3759 |
os = 'macos' ifTrue:[ ^ #macos]. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3760 |
os = 'VMS' ifTrue:[ ^ #vms]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3761 |
os = 'openVMS' ifTrue:[ ^ #vms]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3762 |
^ #unix |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3763 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3764 |
" |
9697 | 3765 |
OperatingSystem knownPlatformNames |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3766 |
OperatingSystem platformName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3767 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3768 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3769 |
"Modified: 20.6.1997 / 17:37:26 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3770 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3771 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3772 |
setLocaleInfo:anInfoDictionary |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3773 |
"set the locale information; if set, this oerrides the OS's settings. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3774 |
(internal in ST/X only - the OS's settings remain unaffected) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3775 |
See description of fields in #getLocaleInfo. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3776 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3777 |
Notice, that (for now), the system does not use this information; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3778 |
it should be used by applications as required." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3779 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3780 |
LocaleInfo := anInfoDictionary |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3781 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3782 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3783 |
|d| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3784 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3785 |
d := IdentityDictionary new. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3786 |
d at:#decimalPoint put:'.' . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3787 |
d at:#thousandsSeparator put:',' . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3788 |
d at:#currencySymbol put:'USD' . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3789 |
d at:#monetaryDecimalPoint put:'.' . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3790 |
d at:#monetaryThousandsSeparator put:'.' . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3791 |
d at:#fractionalDigits put:2 . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3792 |
d at:#positiveSign put:'+' . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3793 |
d at:#negativeSign put:'-' . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3794 |
d at:#positiveSignPrecedesCurrencySymbol put:true . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3795 |
d at:#negativeSignPrecedesCurrencySymbol put:false . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3796 |
OperatingSystem setLocaleInfo:d |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3797 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3798 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3799 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3800 |
supportsChildInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3801 |
"return true, if the OS supports childProcess termination signalling |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3802 |
through interrupts (i.e. SIGCHILD)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3803 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3804 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3805 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3806 |
" |
8669 | 3807 |
OperatingSystem supportsChildInterrupts |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3808 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3809 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3810 |
|
3826 | 3811 |
supportsFileOwnerGroups |
3812 |
"return true, if the OS's file system supports file |
|
3813 |
group ownership - here, we are optimistic assuming that |
|
3814 |
we are running under a real OS. |
|
3815 |
Redefined in Win32OS to return false." |
|
3816 |
||
3817 |
^ true |
|
3818 |
||
3819 |
"Modified: / 10.9.1998 / 17:48:20 / cg" |
|
3820 |
"Created: / 10.9.1998 / 17:56:28 / cg" |
|
3821 |
! |
|
3822 |
||
3823 |
supportsFileOwners |
|
3824 |
"return true, if the OS's file system supports file |
|
3825 |
ownership - here, we are optimistic assuming that |
|
3826 |
we are running under a real OS. |
|
3827 |
Redefined in Win32OS to return false." |
|
3828 |
||
3829 |
^ true |
|
3830 |
||
3831 |
"Modified: / 10.9.1998 / 17:48:20 / cg" |
|
3832 |
"Created: / 10.9.1998 / 17:56:11 / cg" |
|
3833 |
! |
|
3834 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3835 |
supportsIOInterrupts |
8669 | 3836 |
"return true, if the OS supports IO availability interrupts |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3837 |
(i.e. SIGPOLL/SIGIO)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3838 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3839 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3840 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3841 |
" |
8669 | 3842 |
OperatingSystem supportsIOInterrupts |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3843 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3844 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3845 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3846 |
supportsNonBlockingIO |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3847 |
"return true, if the OS supports nonblocking IO." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3848 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3849 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3850 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3851 |
" |
8669 | 3852 |
OperatingSystem supportsNonBlockingIO |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3853 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3854 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3855 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3856 |
supportsSelect |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3857 |
"return true, if the OS supports selecting on multiple |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3858 |
filedescriptors via select. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3859 |
If false is returned, ProcessorScheduler will poll in 50ms |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3860 |
intervals for I/O becoming ready." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3861 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3862 |
^ true |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3863 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3864 |
" |
8669 | 3865 |
OperatingSystem supportsSelect |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3866 |
" |
3901 | 3867 |
! |
3868 |
||
5099 | 3869 |
supportsSelectOnPipes |
3870 |
"return true, if the OS supports selecting on pipe |
|
3871 |
filedescriptors via select. |
|
3872 |
If false is returned, ProcessorScheduler will poll in 50ms |
|
3873 |
intervals for I/O becoming ready." |
|
3874 |
||
3875 |
^ true |
|
3876 |
||
3877 |
" |
|
8669 | 3878 |
OperatingSystem supportsSelectOnPipes |
5099 | 3879 |
" |
3880 |
||
3881 |
"Modified: / 14.12.1999 / 19:40:32 / cg" |
|
3882 |
"Created: / 14.12.1999 / 19:43:43 / cg" |
|
3883 |
! |
|
3884 |
||
3885 |
supportsSelectOnSockets |
|
3886 |
"return true, if the OS supports selecting on socket |
|
3887 |
filedescriptors via select. |
|
3888 |
If false is returned, ProcessorScheduler will poll in 50ms |
|
3889 |
intervals for I/O becoming ready." |
|
3890 |
||
3891 |
^ true |
|
3892 |
||
3893 |
" |
|
8669 | 3894 |
OperatingSystem supportsSelectOnSockets |
5099 | 3895 |
" |
3896 |
||
3897 |
"Modified: / 14.12.1999 / 19:40:32 / cg" |
|
3898 |
! |
|
3899 |
||
3901 | 3900 |
supportsVolumes |
3901 |
"return true, if the OS supports disk volumes. |
|
3902 |
False is returned for UNIX, true for MSDOS and VMS" |
|
3903 |
||
3904 |
^ false |
|
3905 |
||
3906 |
"Created: / 29.10.1998 / 13:20:37 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3907 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3908 |
|
4146 | 3909 |
!AbstractOperatingSystem class methodsFor:'path queries'! |
3910 |
||
5143 | 3911 |
defaultPackagePath |
3912 |
"return a default packagePath - thats a collection of |
|
3913 |
dirnames, where ST/X searches for its package subdirs. |
|
5159
ca0524ab2576
defaultPackagePath initialization fixed
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
3914 |
This method might be redefined in concrete OS's to add |
7770 | 3915 |
OS-specific directory names. |
3916 |
If you set the STX_PACKAGEPATH shell variable, ensure that some of its component |
|
3917 |
points to the directory which *contains* the stx/libbasic directory." |
|
5143 | 3918 |
|
3919 |
|pPath p homePath priv userPrivateSTXDir| |
|
3920 |
||
3921 |
" |
|
3922 |
the path is set to search files first locally |
|
3923 |
- this allows private stuff to override global stuff |
|
3924 |
" |
|
3925 |
pPath := OrderedCollection new. |
|
3926 |
||
3927 |
"/ |
|
3928 |
"/ the current (default) directory |
|
3929 |
"/ |
|
3930 |
pPath add:(Filename currentDirectory name). |
|
3931 |
||
3932 |
"/ |
|
3933 |
"/ the users home (login) directory |
|
3934 |
"/ |
|
3935 |
homePath := OperatingSystem getHomeDirectory. |
|
3936 |
homePath notNil ifTrue:[ |
|
8669 | 3937 |
(pPath includes:homePath) ifFalse:[ |
3938 |
pPath add:homePath. |
|
3939 |
]. |
|
3940 |
||
3941 |
"/ |
|
3942 |
"/ a users private smalltalk directory in its home (login) directory |
|
3943 |
"/ |
|
3944 |
OperatingSystem isUNIXlike ifTrue:[ |
|
3945 |
priv := '.smalltalk'. |
|
3946 |
] ifFalse:[ |
|
3947 |
priv := 'smalltalk'. |
|
3948 |
]. |
|
3949 |
userPrivateSTXDir := homePath asFilename constructString:priv. |
|
3950 |
(userPrivateSTXDir asFilename isDirectory) ifTrue:[ |
|
3951 |
(pPath includes:userPrivateSTXDir) ifFalse:[ |
|
3952 |
pPath add:userPrivateSTXDir |
|
3953 |
] |
|
3954 |
]. |
|
3955 |
]. |
|
5143 | 3956 |
|
3957 |
"/ |
|
5159
ca0524ab2576
defaultPackagePath initialization fixed
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
3958 |
"/ STX_TOPDIR from the environment |
5143 | 3959 |
"/ |
3960 |
p := OperatingSystem getEnvironment:'STX_TOPDIR'. |
|
3961 |
p notNil ifTrue:[ |
|
8669 | 3962 |
(pPath includes:p) ifFalse:[ |
3963 |
pPath add:p |
|
3964 |
]. |
|
5143 | 3965 |
]. |
5172 | 3966 |
pPath add:'/opt/smalltalk'. |
5143 | 3967 |
pPath := pPath select:[:p | (p asFilename construct:'packages') exists]. |
5161 | 3968 |
pPath := pPath collect:[:p | (p asFilename constructString:'packages')]. |
5654 | 3969 |
|
3970 |
(p := OperatingSystem getEnvironment:'STX_PACKAGEPATH') notNil ifTrue:[ |
|
8669 | 3971 |
p := p asCollectionOfSubstringsSeparatedBy:$:. |
3972 |
p reverseDo:[:dir| |
|
3973 |
(pPath includes:dir) ifFalse:[ |
|
3974 |
pPath addFirst:dir. |
|
3975 |
]. |
|
3976 |
]. |
|
5654 | 3977 |
]. |
3978 |
||
5143 | 3979 |
^ pPath |
3980 |
||
3981 |
" |
|
3982 |
self defaultPackagePath |
|
3983 |
" |
|
3984 |
||
5148 | 3985 |
"Modified: / 24.12.1999 / 00:31:29 / cg" |
5143 | 3986 |
! |
3987 |
||
4146 | 3988 |
defaultSystemPath |
3989 |
"return a default systemPath - thats a collection of |
|
3990 |
dirnames, where ST/X searches for its files. |
|
3991 |
This method is redefined in concrete OS's to add |
|
3992 |
OS-specific directory names." |
|
3993 |
||
9021 | 3994 |
|sysPath p appDir homePath priv userPrivateSTXDir| |
4146 | 3995 |
|
3996 |
" |
|
3997 |
the path is set to search files first locally |
|
3998 |
- this allows private stuff to override global stuff |
|
3999 |
" |
|
4000 |
sysPath := OrderedCollection new. |
|
4001 |
||
4002 |
"/ |
|
4003 |
"/ the current (default) directory |
|
4004 |
"/ |
|
9014 | 4005 |
sysPath add:(Filename currentDirectory pathName). |
4146 | 4006 |
|
4007 |
"/ |
|
9021 | 4008 |
"/ the executable's directory (WIN32 only) |
4009 |
"/ |
|
4010 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
4011 |
appDir := Smalltalk commandName asFilename directory pathName. |
|
4012 |
(sysPath includes:appDir) ifFalse:[ |
|
4013 |
sysPath add:appDir. |
|
4014 |
]. |
|
4015 |
]. |
|
4016 |
||
4017 |
"/ |
|
4146 | 4018 |
"/ the users home (login) directory |
4019 |
"/ |
|
4020 |
homePath := OperatingSystem getHomeDirectory. |
|
4021 |
homePath notNil ifTrue:[ |
|
9014 | 4022 |
"/ |
4023 |
"/ a users private smalltalk directory in its home (login) directory |
|
4024 |
"/ |
|
4025 |
OperatingSystem isUNIXlike ifTrue:[ |
|
4026 |
priv := '.smalltalk'. |
|
4027 |
] ifFalse:[ |
|
4028 |
priv := 'smalltalk'. |
|
4029 |
]. |
|
4030 |
userPrivateSTXDir := homePath asFilename constructString:priv. |
|
4031 |
(userPrivateSTXDir asFilename isDirectory) ifTrue:[ |
|
9021 | 4032 |
userPrivateSTXDir := userPrivateSTXDir asFilename pathName. |
9014 | 4033 |
(sysPath includes:userPrivateSTXDir) ifFalse:[ |
4034 |
sysPath add:userPrivateSTXDir |
|
4035 |
] |
|
4036 |
]. |
|
4146 | 4037 |
]. |
4038 |
||
4039 |
"/ |
|
5036 | 4040 |
"/ SMALLTALK_LIBDIR, STX_LIBDIR and STX_TOPDIR from the environment |
4146 | 4041 |
"/ |
9014 | 4042 |
#( |
4043 |
'SMALLTALK_LIBDIR' |
|
4044 |
'STX_LIBDIR' |
|
4045 |
'STX_TOPDIR' |
|
5646
5dfccce8e880
no longer automatically add the home-dir to the systemPath
Claus Gittinger <cg@exept.de>
parents:
5486
diff
changeset
|
4046 |
) do:[:each | |
9014 | 4047 |
p := OperatingSystem getEnvironment:each. |
4048 |
p notNil ifTrue:[ |
|
9021 | 4049 |
p := p asFilename pathName. |
4050 |
(p asFilename isDirectory) ifTrue:[ |
|
4051 |
(sysPath includes:p) ifFalse:[ |
|
4052 |
sysPath add:p |
|
4053 |
] |
|
9014 | 4054 |
] |
4055 |
]. |
|
5036 | 4056 |
]. |
4146 | 4057 |
^ sysPath |
5148 | 4058 |
|
4059 |
"Modified: / 24.12.1999 / 00:30:27 / cg" |
|
4146 | 4060 |
! ! |
4061 |
||
9476 | 4062 |
!AbstractOperatingSystem class methodsFor:'printing support'! |
4063 |
||
4064 |
getPrinterInfoFor: aPrinterName |
|
4065 |
self subclassResponsibility |
|
4066 |
||
4067 |
"Created: / 27-07-2006 / 12:14:18 / fm" |
|
4068 |
! |
|
4069 |
||
4070 |
getPrinters |
|
4071 |
"return a collection of PrinterInfos" |
|
4072 |
||
4073 |
self subclassResponsibility |
|
4074 |
||
4075 |
"Created: / 27-07-2006 / 12:17:31 / fm" |
|
4076 |
! ! |
|
4077 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4078 |
!AbstractOperatingSystem class methodsFor:'private'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4079 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4080 |
osProcessStatusClass |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4081 |
^ self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4082 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4083 |
"Created: / 12.6.1998 / 16:30:29 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4084 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4085 |
|
7656 | 4086 |
!AbstractOperatingSystem class methodsFor:'queries-sockets'! |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4087 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4088 |
domainCodeOf:aSymbolOrInteger |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4089 |
"return the numeric AF_xxx code of a given symbolic domain name. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4090 |
Return nil for invalid or unsupported domains. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4091 |
For backward compatibility, the obsolete (non-AF-prefixed) names |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4092 |
are still supported for a while - this support will vanish." |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4093 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4094 |
|domainCode| |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4095 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4096 |
%{ /*NOCONTEXT*/ |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4097 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4098 |
if (__isSmallInteger(aSymbolOrInteger) || aSymbolOrInteger == nil) { |
7711 | 4099 |
RETURN (aSymbolOrInteger); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4100 |
} |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4101 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4102 |
#ifdef AF_INET |
8669 | 4103 |
else if ((aSymbolOrInteger == @symbol(AF_INET)) || (aSymbolOrInteger == @symbol(inet))) |
8913 | 4104 |
domainCode = __mkSmallInteger(AF_INET); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4105 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4106 |
#ifdef AF_INET6 |
8669 | 4107 |
else if ((aSymbolOrInteger == @symbol(AF_INET6)) || (aSymbolOrInteger == @symbol(inet6))) |
8913 | 4108 |
domainCode = __mkSmallInteger(AF_INET6); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4109 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4110 |
#ifdef AF_UNIX |
8669 | 4111 |
else if ((aSymbolOrInteger == @symbol(AF_UNIX)) || (aSymbolOrInteger == @symbol(unix))) |
8913 | 4112 |
domainCode = __mkSmallInteger(AF_UNIX); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4113 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4114 |
#ifdef AF_APPLETALK |
8669 | 4115 |
else if ((aSymbolOrInteger == @symbol(AF_APPLETALK)) || (aSymbolOrInteger == @symbol(appletalk))) |
8913 | 4116 |
domainCode = __mkSmallInteger(AF_APPLETALK); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4117 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4118 |
#ifdef AF_DECnet |
8669 | 4119 |
else if ((aSymbolOrInteger == @symbol(AF_DECnet)) || (aSymbolOrInteger == @symbol(decnet))) |
8913 | 4120 |
domainCode = __mkSmallInteger(AF_DECnet); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4121 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4122 |
#ifdef AF_NS |
8669 | 4123 |
else if ((aSymbolOrInteger == @symbol(AF_NS)) || (aSymbolOrInteger == @symbol(ns))) |
8913 | 4124 |
domainCode = __mkSmallInteger(AF_NS); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4125 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4126 |
#ifdef AF_X25 |
8669 | 4127 |
else if ((aSymbolOrInteger == @symbol(AF_X25)) || (aSymbolOrInteger == @symbol(x25))) |
8913 | 4128 |
domainCode = __mkSmallInteger(AF_X25); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4129 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4130 |
#ifdef AF_SNA |
8669 | 4131 |
else if (aSymbolOrInteger == @symbol(AF_SNA)) |
8913 | 4132 |
domainCode = __mkSmallInteger(AF_SNA); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4133 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4134 |
#ifdef AF_RAW |
8669 | 4135 |
else if ((aSymbolOrInteger == @symbol(AF_RAW)) || (aSymbolOrInteger == @symbol(raw))) |
8913 | 4136 |
domainCode = __mkSmallInteger(AF_RAW); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4137 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4138 |
#ifdef AF_ISO |
8669 | 4139 |
else if ((aSymbolOrInteger == @symbol(AF_ISO)) || (aSymbolOrInteger == @symbol(iso))) |
8913 | 4140 |
domainCode = __mkSmallInteger(AF_ISO); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4141 |
#endif |
8784 | 4142 |
#ifdef AF_ECMA |
4143 |
else if (aSymbolOrInteger == @symbol(AF_ECMA)) |
|
8913 | 4144 |
domainCode = __mkSmallInteger(AF_ECMA); |
8784 | 4145 |
#endif |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4146 |
#ifdef AF_NETBIOS |
8669 | 4147 |
else if ((aSymbolOrInteger == @symbol(AF_NETBIOS)) || (aSymbolOrInteger == @symbol(netbios))) |
8913 | 4148 |
domainCode = __mkSmallInteger(AF_NETBIOS); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4149 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4150 |
#ifdef AF_NETBEUI |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4151 |
else if (aSymbolOrInteger == @symbol(AF_NETBEUI)) |
8913 | 4152 |
domainCode = __mkSmallInteger(AF_NETBEUI); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4153 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4154 |
#ifdef AF_IPX |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4155 |
else if (aSymbolOrInteger == @symbol(AF_IPX)) |
8913 | 4156 |
domainCode = __mkSmallInteger(AF_IPX); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4157 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4158 |
#ifdef AF_AX25 |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4159 |
else if (aSymbolOrInteger == @symbol(AF_AX25)) |
8913 | 4160 |
domainCode = __mkSmallInteger(AF_AX25); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4161 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4162 |
#ifdef AF_NETROM |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4163 |
else if (aSymbolOrInteger == @symbol(AF_NETROM)) |
8913 | 4164 |
domainCode = __mkSmallInteger(AF_NETROM); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4165 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4166 |
#ifdef AF_BRIDGE |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4167 |
else if (aSymbolOrInteger == @symbol(AF_BRIDGE)) |
8913 | 4168 |
domainCode = __mkSmallInteger(AF_BRIDGE); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4169 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4170 |
#ifdef AF_BSC |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4171 |
else if (aSymbolOrInteger == @symbol(AF_BSC)) |
8913 | 4172 |
domainCode = __mkSmallInteger(AF_BSC); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4173 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4174 |
#ifdef AF_ROSE |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4175 |
else if (aSymbolOrInteger == @symbol(AF_ROSE)) |
8913 | 4176 |
domainCode = __mkSmallInteger(AF_ROSE); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4177 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4178 |
#ifdef AF_IRDA |
8669 | 4179 |
else if ((aSymbolOrInteger == @symbol(AF_IRDA)) || (aSymbolOrInteger == @symbol(irda))) |
8913 | 4180 |
domainCode = __mkSmallInteger(AF_IRDA); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4181 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4182 |
#ifdef AF_BAN |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4183 |
else if (aSymbolOrInteger == @symbol(AF_BAN)) |
8913 | 4184 |
domainCode = __mkSmallInteger(AF_BAN); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4185 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4186 |
#ifdef AF_VOICEVIEW |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4187 |
else if (aSymbolOrInteger == @symbol(AF_VOICEVIEW)) |
8913 | 4188 |
domainCode = __mkSmallInteger(AF_VOICEVIEW); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4189 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4190 |
#ifdef AF_ATM |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4191 |
else if (aSymbolOrInteger == @symbol(AF_ATM)) |
8913 | 4192 |
domainCode = __mkSmallInteger(AF_ATM); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4193 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4194 |
#ifdef AF_ATMPVC |
8669 | 4195 |
else if (aSymbolOrInteger == @symbol(AF_ATMPVC)) |
8913 | 4196 |
domainCode = __mkSmallInteger(AF_ATMPVC); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4197 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4198 |
#ifdef AF_ATMSVC |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4199 |
else if (aSymbolOrInteger == @symbol(AF_ATMSVC)) |
8913 | 4200 |
domainCode = __mkSmallInteger(AF_ATMSVC); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4201 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4202 |
#ifdef AF_SECURITY |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4203 |
else if (aSymbolOrInteger == @symbol(AF_SECURITY)) |
8913 | 4204 |
domainCode = __mkSmallInteger(AF_SECURITY); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4205 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4206 |
#ifdef AF_KEY |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4207 |
else if (aSymbolOrInteger == @symbol(AF_KEY)) |
8913 | 4208 |
domainCode = __mkSmallInteger(AF_KEY); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4209 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4210 |
#ifdef AF_NETLINK |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4211 |
else if (aSymbolOrInteger == @symbol(AF_NETLINK)) |
8913 | 4212 |
domainCode = __mkSmallInteger(AF_NETLINK); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4213 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4214 |
#ifdef AF_PACKET |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4215 |
else if (aSymbolOrInteger == @symbol(AF_PACKET)) |
8913 | 4216 |
domainCode = __mkSmallInteger(AF_PACKET); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4217 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4218 |
#ifdef AF_ASH |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4219 |
else if (aSymbolOrInteger == @symbol(AF_ASH)) |
8913 | 4220 |
domainCode = __mkSmallInteger(AF_ASH); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4221 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4222 |
#ifdef AF_ECONET |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4223 |
else if (aSymbolOrInteger == @symbol(AF_ECONET)) |
8913 | 4224 |
domainCode = __mkSmallInteger(AF_ECONET); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4225 |
#endif |
7716 | 4226 |
#ifdef AF_IMPLINK |
4227 |
else if (aSymbolOrInteger == @symbol(AF_IMPLINK)) |
|
8913 | 4228 |
domainCode = __mkSmallInteger(AF_IMPLINK); |
7716 | 4229 |
#endif |
8784 | 4230 |
#ifdef AF_PUP |
4231 |
else if (aSymbolOrInteger == @symbol(AF_PUP)) |
|
8913 | 4232 |
domainCode = __mkSmallInteger(AF_PUP); |
8784 | 4233 |
#endif |
7716 | 4234 |
#ifdef AF_CHAOS |
4235 |
else if (aSymbolOrInteger == @symbol(AF_CHAOS)) |
|
8913 | 4236 |
domainCode = __mkSmallInteger(AF_CHAOS); |
7716 | 4237 |
#endif |
4238 |
#ifdef AF_DLI |
|
4239 |
else if (aSymbolOrInteger == @symbol(AF_DLI)) |
|
8913 | 4240 |
domainCode = __mkSmallInteger(AF_DLI); |
7716 | 4241 |
#endif |
4242 |
#ifdef AF_LAT |
|
4243 |
else if (aSymbolOrInteger == @symbol(AF_LAT)) |
|
8913 | 4244 |
domainCode = __mkSmallInteger(AF_LAT); |
7716 | 4245 |
#endif |
4246 |
#ifdef AF_HYLINK |
|
4247 |
else if (aSymbolOrInteger == @symbol(AF_HYLINK)) |
|
8913 | 4248 |
domainCode = __mkSmallInteger(AF_HYLINK); |
7716 | 4249 |
#endif |
4250 |
#ifdef AF_FIREFOX |
|
4251 |
else if (aSymbolOrInteger == @symbol(AF_FIREFOX)) |
|
8913 | 4252 |
domainCode = __mkSmallInteger(AF_FIREFOX); |
7716 | 4253 |
#endif |
4254 |
#ifdef AF_CLUSTER |
|
4255 |
else if (aSymbolOrInteger == @symbol(AF_CLUSTER)) |
|
8913 | 4256 |
domainCode = __mkSmallInteger(AF_CLUSTER); |
7716 | 4257 |
#endif |
4258 |
#ifdef AF_12844 |
|
4259 |
else if (aSymbolOrInteger == @symbol(AF_12844)) |
|
8913 | 4260 |
domainCode = __mkSmallInteger(AF_12844); |
7716 | 4261 |
#endif |
4262 |
#ifdef AF_NETDES |
|
4263 |
else if (aSymbolOrInteger == @symbol(AF_NETDES)) |
|
8913 | 4264 |
domainCode = __mkSmallInteger(AF_NETDES); |
7716 | 4265 |
#endif |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4266 |
%}. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4267 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4268 |
^ domainCode. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4269 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4270 |
" |
8669 | 4271 |
self domainCodeOf:#AF_INET |
4272 |
self domainCodeOf:#AF_INET6 |
|
4273 |
self domainCodeOf:#AF_UNIX |
|
4274 |
self domainCodeOf:#AF_APPLETALK |
|
4275 |
self domainCodeOf:#AF_DECNET |
|
4276 |
" |
|
4277 |
"for backward compatibility only: |
|
4278 |
self domainCodeOf:#inet |
|
4279 |
self domainCodeOf:#inet6 |
|
4280 |
self domainCodeOf:#unix |
|
4281 |
self domainCodeOf:#appletalk |
|
4282 |
self domainCodeOf:#decnet |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4283 |
" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4284 |
! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4285 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4286 |
domainSymbolOf:anInteger |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4287 |
"return the symbolic domainName of a given numeric AF_xxx code. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4288 |
Return nil for invalid or unsupported domains." |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4289 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4290 |
|domainSymbol| |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4291 |
|
8669 | 4292 |
%{ /*NOCONTEXT*/ |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4293 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4294 |
if (__isSmallInteger(anInteger)) { |
7711 | 4295 |
switch(__intVal(anInteger)) { |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4296 |
#ifdef AF_INET |
7711 | 4297 |
case AF_INET: |
4298 |
domainSymbol = @symbol(AF_INET); |
|
4299 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4300 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4301 |
#ifdef AF_INET6 |
7711 | 4302 |
case AF_INET6: |
4303 |
domainSymbol = @symbol(AF_INET6); |
|
4304 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4305 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4306 |
#ifdef AF_UNIX |
7711 | 4307 |
case AF_UNIX: |
4308 |
domainSymbol = @symbol(AF_UNIX); |
|
4309 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4310 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4311 |
#ifdef AF_APPLETALK |
7711 | 4312 |
case AF_APPLETALK: |
4313 |
domainSymbol = @symbol(AF_APPLETALK); |
|
4314 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4315 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4316 |
#ifdef AF_DECnet |
7711 | 4317 |
case AF_DECnet: |
4318 |
domainSymbol = @symbol(AF_DECnet); |
|
4319 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4320 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4321 |
#ifdef AF_NS |
7711 | 4322 |
case AF_NS: |
4323 |
domainSymbol = @symbol(AF_NS); |
|
4324 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4325 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4326 |
#ifdef AF_X25 |
7711 | 4327 |
case AF_X25: |
4328 |
domainSymbol = @symbol(AF_X25); |
|
4329 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4330 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4331 |
#ifdef AF_SNA |
7711 | 4332 |
case AF_SNA: |
4333 |
domainSymbol = @symbol(AF_SNA); |
|
4334 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4335 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4336 |
#ifdef AF_RAW |
7711 | 4337 |
case AF_RAW: |
4338 |
domainSymbol = @symbol(AF_RAW); |
|
4339 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4340 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4341 |
#ifdef AF_ISO |
7711 | 4342 |
case AF_ISO: |
4343 |
domainSymbol = @symbol(AF_ISO); |
|
4344 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4345 |
#endif |
8784 | 4346 |
#ifdef AF_ECMA |
4347 |
case AF_ECMA: |
|
4348 |
domainSymbol = @symbol(AF_ECMA); |
|
4349 |
break; |
|
4350 |
#endif |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4351 |
#ifdef AF_NETBIOS |
7711 | 4352 |
case AF_NETBIOS: |
4353 |
domainSymbol = @symbol(AF_NETBIOS); |
|
4354 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4355 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4356 |
#ifdef AF_IPX |
7711 | 4357 |
case AF_IPX: |
4358 |
domainSymbol = @symbol(AF_IPX); |
|
4359 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4360 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4361 |
#ifdef AF_AX25 |
7711 | 4362 |
case AF_AX25: |
4363 |
domainSymbol = @symbol(AF_AX25); |
|
4364 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4365 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4366 |
#ifdef AF_NETROM |
7711 | 4367 |
case AF_NETROM: |
4368 |
domainSymbol = @symbol(AF_NETROM); |
|
4369 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4370 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4371 |
#ifdef AF_BRIDGE |
7711 | 4372 |
case AF_BRIDGE: |
4373 |
domainSymbol = @symbol(AF_BRIDGE); |
|
4374 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4375 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4376 |
#ifdef AF_BSC |
7711 | 4377 |
case AF_BSC: |
4378 |
domainSymbol = @symbol(AF_BSC); |
|
4379 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4380 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4381 |
#ifdef AF_ROSE |
7711 | 4382 |
case AF_ROSE: |
4383 |
domainSymbol = @symbol(AF_ROSE); |
|
4384 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4385 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4386 |
#ifdef AF_IRDA |
7711 | 4387 |
case AF_IRDA: |
4388 |
domainSymbol = @symbol(AF_IRDA); |
|
4389 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4390 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4391 |
#ifdef AF_BAN |
7711 | 4392 |
case AF_BAN: |
4393 |
domainSymbol = @symbol(AF_BAN); |
|
4394 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4395 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4396 |
#ifdef AF_VOICEVIEW |
7711 | 4397 |
case AF_VOICEVIEW: |
4398 |
domainSymbol = @symbol(AF_VOICEVIEW); |
|
4399 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4400 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4401 |
#ifdef AF_ATM |
7711 | 4402 |
case AF_ATM: |
4403 |
domainSymbol = @symbol(AF_ATM); |
|
4404 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4405 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4406 |
#ifdef AF_ATMPVC |
7711 | 4407 |
case AF_ATMPVC: |
4408 |
domainSymbol = @symbol(AF_ATMPVC); |
|
4409 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4410 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4411 |
#ifdef AF_ATMSVC |
7711 | 4412 |
case AF_ATMSVC: |
4413 |
domainSymbol = @symbol(AF_ATMSVC); |
|
4414 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4415 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4416 |
#ifdef AF_SECURITY |
7711 | 4417 |
case AF_SECURITY: |
4418 |
domainSymbol = @symbol(AF_SECURITY); |
|
4419 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4420 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4421 |
#ifdef AF_KEY |
7711 | 4422 |
case AF_KEY: |
4423 |
domainSymbol = @symbol(AF_KEY); |
|
4424 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4425 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4426 |
#ifdef AF_NETLINK |
7711 | 4427 |
case AF_NETLINK: |
4428 |
domainSymbol = @symbol(AF_NETLINK); |
|
4429 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4430 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4431 |
#ifdef AF_PACKET |
7711 | 4432 |
case AF_PACKET: |
4433 |
domainSymbol = @symbol(AF_PACKET); |
|
4434 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4435 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4436 |
#ifdef AF_ASH |
7711 | 4437 |
case AF_ASH: |
4438 |
domainSymbol = @symbol(AF_ASH); |
|
4439 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4440 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4441 |
#ifdef AF_ECONET |
7711 | 4442 |
case AF_ECONET: |
4443 |
domainSymbol = @symbol(AF_ECONET); |
|
4444 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4445 |
#endif |
7716 | 4446 |
#ifdef AF_IMPLINK |
4447 |
case AF_IMPLINK: |
|
4448 |
domainSymbol = @symbol(AF_IMPLINK); |
|
4449 |
break; |
|
4450 |
#endif |
|
8784 | 4451 |
#ifdef AF_PUP |
4452 |
case AF_PUP: |
|
4453 |
domainSymbol = @symbol(AF_PUP); |
|
4454 |
break; |
|
4455 |
#endif |
|
7716 | 4456 |
#ifdef AF_CHAOS |
4457 |
case AF_CHAOS: |
|
4458 |
domainSymbol = @symbol(AF_CHAOS); |
|
4459 |
break; |
|
4460 |
#endif |
|
4461 |
#ifdef AF_DLI |
|
4462 |
case AF_DLI: |
|
4463 |
domainSymbol = @symbol(AF_DLI); |
|
4464 |
break; |
|
4465 |
#endif |
|
4466 |
#ifdef AF_LAT |
|
4467 |
case AF_LAT: |
|
4468 |
domainSymbol = @symbol(AF_LAT); |
|
4469 |
break; |
|
4470 |
#endif |
|
4471 |
#ifdef AF_HYLINK |
|
4472 |
case AF_HYLINK: |
|
4473 |
domainSymbol = @symbol(AF_HYLINK); |
|
4474 |
break; |
|
4475 |
#endif |
|
4476 |
#ifdef AF_FIREFOX |
|
4477 |
case AF_FIREFOX: |
|
4478 |
domainSymbol = @symbol(AF_FIREFOX); |
|
4479 |
break; |
|
4480 |
#endif |
|
4481 |
#ifdef AF_CLUSTER |
|
4482 |
case AF_CLUSTER: |
|
4483 |
domainSymbol = @symbol(AF_CLUSTER); |
|
4484 |
break; |
|
4485 |
#endif |
|
4486 |
#ifdef AF_12844 |
|
4487 |
case AF_12844: |
|
4488 |
domainSymbol = @symbol(AF_12844); |
|
4489 |
break; |
|
4490 |
#endif |
|
4491 |
#ifdef AF_NETDES |
|
4492 |
case AF_NETDES: |
|
4493 |
domainSymbol = @symbol(AF_NETDES); |
|
4494 |
break; |
|
4495 |
#endif |
|
7711 | 4496 |
} |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4497 |
} |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4498 |
%}. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4499 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4500 |
^ domainSymbol. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4501 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4502 |
" |
8669 | 4503 |
self domainSymbolOf:(self domainCodeOf:#inet) |
4504 |
self domainSymbolOf:(self domainCodeOf:#inet6) |
|
4505 |
self domainSymbolOf:(self domainCodeOf:#unix) |
|
4506 |
self domainSymbolOf:(self domainCodeOf:#appletalk) |
|
4507 |
self domainSymbolOf:(self domainCodeOf:#decnet) |
|
4508 |
self domainSymbolOf:(self domainCodeOf:#raw) |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4509 |
" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4510 |
! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4511 |
|
8784 | 4512 |
protocolCodeOf:aSymbolOrInteger |
4513 |
"return the numeric IPPROTO_xxx code of a given symbolic protocol name. |
|
4514 |
Return nil for invalid or unsupported protocols. |
|
4515 |
For backward compatibility, the obsolete (non-IPPROTO-prefixed) names |
|
4516 |
are still supported for a while - this support will vanish." |
|
4517 |
||
4518 |
|protocolCode| |
|
4519 |
||
4520 |
%{ /*NOCONTEXT*/ |
|
4521 |
||
4522 |
if (__isSmallInteger(aSymbolOrInteger) || aSymbolOrInteger == nil) { |
|
4523 |
RETURN (aSymbolOrInteger); |
|
4524 |
} |
|
4525 |
||
4526 |
#ifdef IPPROTO_IP |
|
4527 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_IP)) || (aSymbolOrInteger == @symbol(ip))) |
|
8913 | 4528 |
protocolCode = __mkSmallInteger(IPPROTO_IP); |
8784 | 4529 |
#endif |
4530 |
#ifdef IPPROTO_ICMP |
|
4531 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_ICMP)) || (aSymbolOrInteger == @symbol(icmp))) |
|
8913 | 4532 |
protocolCode = __mkSmallInteger(IPPROTO_ICMP); |
8784 | 4533 |
#endif |
4534 |
#ifdef IPPROTO_IGMP |
|
4535 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_IGMP)) || (aSymbolOrInteger == @symbol(igmp))) |
|
8913 | 4536 |
protocolCode = __mkSmallInteger(IPPROTO_IGMP); |
8784 | 4537 |
#endif |
4538 |
#ifdef IPPROTO_GGP |
|
4539 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_GGP)) || (aSymbolOrInteger == @symbol(ggp))) |
|
8913 | 4540 |
protocolCode = __mkSmallInteger(IPPROTO_GGP); |
8784 | 4541 |
#endif |
4542 |
#ifdef IPPROTO_TCP |
|
4543 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_TCP)) || (aSymbolOrInteger == @symbol(tcp))) |
|
8913 | 4544 |
protocolCode = __mkSmallInteger(IPPROTO_TCP); |
8784 | 4545 |
#endif |
4546 |
#ifdef IPPROTO_UDP |
|
4547 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_UDP)) || (aSymbolOrInteger == @symbol(udp))) |
|
8913 | 4548 |
protocolCode = __mkSmallInteger(IPPROTO_UDP); |
8784 | 4549 |
#endif |
4550 |
#ifdef IPPROTO_IDP |
|
4551 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_IDP)) || (aSymbolOrInteger == @symbol(idp))) |
|
8913 | 4552 |
protocolCode = __mkSmallInteger(IPPROTO_IDP); |
8784 | 4553 |
#endif |
4554 |
#ifdef IPPROTO_ND |
|
4555 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_ND)) || (aSymbolOrInteger == @symbol(nd))) |
|
8913 | 4556 |
protocolCode = __mkSmallInteger(IPPROTO_ND); |
8784 | 4557 |
#endif |
4558 |
#ifdef IPPROTO_RAW |
|
4559 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_RAW)) || (aSymbolOrInteger == @symbol(raw))) |
|
8913 | 4560 |
protocolCode = __mkSmallInteger(IPPROTO_RAW); |
8784 | 4561 |
#endif |
4562 |
%}. |
|
4563 |
||
4564 |
^ protocolCode. |
|
4565 |
||
4566 |
" |
|
4567 |
self protocolCodeOf:#IPPROTO_UDP |
|
4568 |
self protocolCodeOf:#IPPROTO_TCP |
|
4569 |
" |
|
4570 |
"for backward compatibility only: |
|
4571 |
self protocolCodeOf:#udp |
|
4572 |
self protocolCodeOf:#tcp |
|
4573 |
" |
|
4574 |
! |
|
4575 |
||
4576 |
protocolSymbolOf:anInteger |
|
4577 |
"return the symbolic protocolName of a given numeric IPPROTO_xxx code. |
|
4578 |
Return nil for invalid or unsupported protocols." |
|
4579 |
||
4580 |
|protocolSymbol| |
|
4581 |
||
4582 |
%{ /*NOCONTEXT*/ |
|
4583 |
||
4584 |
if (__isSmallInteger(anInteger)) { |
|
4585 |
switch(__intVal(anInteger)) { |
|
4586 |
#ifdef IPPROTO_IP |
|
4587 |
case IPPROTO_IP: |
|
4588 |
// protocolSymbol = @symbol(IPPROTO_IP); |
|
4589 |
protocolSymbol = @symbol(ip); |
|
4590 |
break; |
|
4591 |
#endif |
|
4592 |
#ifdef IPPROTO_ICMP |
|
4593 |
case IPPROTO_ICMP: |
|
4594 |
// protocolSymbol = @symbol(IPPROTO_ICMP); |
|
4595 |
protocolSymbol = @symbol(icmp); |
|
4596 |
break; |
|
4597 |
#endif |
|
4598 |
#ifdef IPPROTO_IGMP |
|
4599 |
case IPPROTO_IGMP: |
|
4600 |
// protocolSymbol = @symbol(IPPROTO_IGMP); |
|
4601 |
protocolSymbol = @symbol(igmp); |
|
4602 |
break; |
|
4603 |
#endif |
|
4604 |
#ifdef IPPROTO_GGP |
|
4605 |
case IPPROTO_GGP: |
|
4606 |
// protocolSymbol = @symbol(IPPROTO_GGP); |
|
4607 |
protocolSymbol = @symbol(ggp); |
|
4608 |
break; |
|
4609 |
#endif |
|
4610 |
#ifdef IPPROTO_TCP |
|
4611 |
case IPPROTO_TCP: |
|
4612 |
// protocolSymbol = @symbol(IPPROTO_TCP); |
|
4613 |
protocolSymbol = @symbol(tcp); |
|
4614 |
break; |
|
4615 |
#endif |
|
4616 |
#ifdef IPPROTO_PUP |
|
4617 |
case IPPROTO_PUP: |
|
4618 |
// protocolSymbol = @symbol(IPPROTO_PUP); |
|
4619 |
protocolSymbol = @symbol(pup); |
|
4620 |
break; |
|
4621 |
#endif |
|
4622 |
#ifdef IPPROTO_UDP |
|
4623 |
case IPPROTO_UDP: |
|
4624 |
// protocolSymbol = @symbol(IPPROTO_UDP); |
|
4625 |
protocolSymbol = @symbol(udp); |
|
4626 |
break; |
|
4627 |
#endif |
|
4628 |
#ifdef IPPROTO_IDP |
|
4629 |
case IPPROTO_IDP: |
|
4630 |
// protocolSymbol = @symbol(IPPROTO_IDP); |
|
4631 |
protocolSymbol = @symbol(idp); |
|
4632 |
break; |
|
4633 |
#endif |
|
4634 |
#ifdef IPPROTO_ND |
|
4635 |
case IPPROTO_ND: |
|
4636 |
// protocolSymbol = @symbol(IPPROTO_ND); |
|
4637 |
protocolSymbol = @symbol(nd); |
|
4638 |
break; |
|
4639 |
#endif |
|
4640 |
#ifdef IPPROTO_RAW |
|
4641 |
case IPPROTO_RAW: |
|
4642 |
// protocolSymbol = @symbol(IPPROTO_RAW); |
|
4643 |
protocolSymbol = @symbol(raw); |
|
4644 |
break; |
|
4645 |
#endif |
|
4646 |
} |
|
4647 |
} |
|
4648 |
%}. |
|
4649 |
||
4650 |
^ protocolSymbol. |
|
4651 |
||
4652 |
" |
|
4653 |
self protocolSymbolOf:(self protocolCodeOf:#tcp) |
|
4654 |
self protocolSymbolOf:(self protocolCodeOf:#udp) |
|
4655 |
self protocolSymbolOf:(self protocolCodeOf:#raw) |
|
4656 |
" |
|
4657 |
! |
|
4658 |
||
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4659 |
socketAddressSizeOfDomain:aSymbolOrInteger |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4660 |
"Return the os-specific size of a socket address for a domain aSymbolOrInteger. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4661 |
Return nil, if unknown or unsupported." |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4662 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4663 |
|socketSize domainCode| |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4664 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4665 |
domainCode := OperatingSystem domainCodeOf:aSymbolOrInteger. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4666 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4667 |
%{ |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4668 |
if (__isSmallInteger(domainCode)) { |
7711 | 4669 |
switch (__intVal(domainCode)) { |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4670 |
#ifdef AF_INET |
8669 | 4671 |
case AF_INET: |
8913 | 4672 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_in) ); |
7711 | 4673 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4674 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4675 |
#ifdef AF_INET6 |
8669 | 4676 |
case AF_INET6: |
8913 | 4677 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_in6) ); |
7711 | 4678 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4679 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4680 |
#ifdef AF_UNIX |
8669 | 4681 |
case AF_UNIX: |
8913 | 4682 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_un) ); |
7711 | 4683 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4684 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4685 |
#ifdef AF_APPLETALK |
8669 | 4686 |
case AF_APPLETALK: |
8913 | 4687 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_at) ); |
7711 | 4688 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4689 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4690 |
#ifdef AF_DECnet |
8669 | 4691 |
case AF_DECnet: |
8913 | 4692 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_dn) ); |
7711 | 4693 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4694 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4695 |
#ifdef AF_NS |
8669 | 4696 |
case AF_NS: |
8913 | 4697 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_ns) ); |
7711 | 4698 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4699 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4700 |
#ifdef AF_X25 |
8669 | 4701 |
case AF_X25: |
8913 | 4702 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_x25) ); |
7711 | 4703 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4704 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4705 |
#ifdef AF_SNA |
8669 | 4706 |
case AF_SNA: |
8913 | 4707 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_sna) ); |
7711 | 4708 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4709 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4710 |
#ifdef AF_RAW |
8669 | 4711 |
case AF_RAW: |
8913 | 4712 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_raw) ); |
7711 | 4713 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4714 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4715 |
#ifdef AF_ISO |
8669 | 4716 |
case AF_ISO: |
8913 | 4717 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_iso) ); |
7711 | 4718 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4719 |
#endif |
8784 | 4720 |
#ifdef AF_ECMA |
4721 |
# if 0 |
|
4722 |
case AF_ECMA: |
|
8913 | 4723 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_ecma) ); |
8784 | 4724 |
break; |
4725 |
# endif |
|
4726 |
#endif |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4727 |
#ifdef AF_NETBIOS |
8669 | 4728 |
case AF_NETBIOS: |
8913 | 4729 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_netbios) ); |
7711 | 4730 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4731 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4732 |
#ifdef AF_NETBEUI |
8669 | 4733 |
case AF_NETBEUI: |
8913 | 4734 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_netbeui) ); |
7711 | 4735 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4736 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4737 |
#ifdef AF_IPX |
8669 | 4738 |
case AF_IPX: |
8913 | 4739 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_ipx) ); |
7711 | 4740 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4741 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4742 |
#ifdef AF_AX25 |
8669 | 4743 |
case AF_AX25: |
8913 | 4744 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_ax25) ); |
7711 | 4745 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4746 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4747 |
#ifdef AF_NETROM |
8669 | 4748 |
case AF_NETROM: |
8913 | 4749 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_netrom) ); |
7711 | 4750 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4751 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4752 |
#ifdef AF_BRIDGE |
8669 | 4753 |
case AF_BRIDGE: |
8913 | 4754 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_bridge) ); |
7711 | 4755 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4756 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4757 |
#ifdef AF_BSC |
8669 | 4758 |
case AF_BSC: |
8913 | 4759 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_bsc) ); |
7711 | 4760 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4761 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4762 |
#ifdef AF_ROSE |
8669 | 4763 |
case AF_ROSE: |
8913 | 4764 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_rose) ); |
7711 | 4765 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4766 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4767 |
#ifdef AF_IRDA |
8669 | 4768 |
case AF_IRDA: |
8913 | 4769 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_irda) ); |
7711 | 4770 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4771 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4772 |
#ifdef AF_BAN |
8669 | 4773 |
case AF_BAN: |
8913 | 4774 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_ban) ); |
7711 | 4775 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4776 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4777 |
#ifdef AF_VOICEVIEW |
8669 | 4778 |
case AF_VOICEVIEW: |
8913 | 4779 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_voiceview) ); |
7711 | 4780 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4781 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4782 |
#ifdef AF_ATM |
8669 | 4783 |
case AF_ATM: |
8913 | 4784 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_atm) ); |
7711 | 4785 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4786 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4787 |
#ifdef AF_ATMPVC |
8669 | 4788 |
case AF_ATMPVC: |
8913 | 4789 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_atmpvc) ); |
7711 | 4790 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4791 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4792 |
#ifdef AF_ATMSVC |
8669 | 4793 |
case AF_ATMSVC: |
8913 | 4794 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_atmsvc) ); |
7711 | 4795 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4796 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4797 |
#ifdef AF_NETLINK |
8669 | 4798 |
case AF_NETLINK: |
8913 | 4799 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_netlink) ); |
7711 | 4800 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4801 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4802 |
#ifdef AF_PACKET |
8669 | 4803 |
case AF_PACKET: |
8913 | 4804 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_packet) ); |
7711 | 4805 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4806 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4807 |
#ifdef AF_ASH |
8669 | 4808 |
case AF_ASH: |
8913 | 4809 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_ash) ); |
7711 | 4810 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4811 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4812 |
#ifdef AF_ECONET |
8669 | 4813 |
case AF_ECONET: |
8913 | 4814 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_eco) ); |
7711 | 4815 |
break; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4816 |
#endif |
7716 | 4817 |
#ifdef AF_IMPLINK |
8669 | 4818 |
case AF_IMPLINK: |
8913 | 4819 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_implink) ); |
7716 | 4820 |
break; |
4821 |
#endif |
|
8784 | 4822 |
#ifdef AF_PUP |
4823 |
# if 0 |
|
4824 |
case AF_PUP: |
|
8913 | 4825 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_pup) ); |
8784 | 4826 |
break; |
4827 |
# endif |
|
4828 |
#endif |
|
7716 | 4829 |
#ifdef AF_CHAOS |
8669 | 4830 |
case AF_CHAOS: |
8913 | 4831 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_chaos) ); |
7716 | 4832 |
break; |
4833 |
#endif |
|
4834 |
#ifdef AF_DLI |
|
8669 | 4835 |
case AF_DLI: |
8913 | 4836 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_dli) ); |
7716 | 4837 |
break; |
4838 |
#endif |
|
4839 |
#ifdef AF_LAT |
|
8669 | 4840 |
case AF_LAT: |
8913 | 4841 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_lat) ); |
7716 | 4842 |
break; |
4843 |
#endif |
|
4844 |
#ifdef AF_HYLINK |
|
8669 | 4845 |
case AF_HYLINK: |
8913 | 4846 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_hylink) ); |
7716 | 4847 |
break; |
4848 |
#endif |
|
4849 |
#ifdef AF_FIREFOX |
|
8669 | 4850 |
case AF_FIREFOX: |
8913 | 4851 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_firefox) ); |
7716 | 4852 |
break; |
4853 |
#endif |
|
4854 |
#ifdef AF_CLUSTER |
|
8669 | 4855 |
case AF_CLUSTER: |
8913 | 4856 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_cluster) ); |
7716 | 4857 |
break; |
4858 |
#endif |
|
4859 |
#ifdef AF_12844 |
|
8669 | 4860 |
case AF_12844: |
8913 | 4861 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_12844) ); |
7716 | 4862 |
break; |
4863 |
#endif |
|
4864 |
#ifdef AF_NETDES |
|
8669 | 4865 |
case AF_NETDES: |
8913 | 4866 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_netdes) ); |
7716 | 4867 |
break; |
4868 |
#endif |
|
7711 | 4869 |
} |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4870 |
} |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4871 |
%}. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4872 |
^ socketSize |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4873 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4874 |
" |
8669 | 4875 |
self socketAddressSizeOfDomain:#'AF_INET' |
4876 |
self socketAddressSizeOfDomain:#'AF_UNIX' |
|
4877 |
self socketAddressSizeOfDomain:#'Foo' |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4878 |
" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4879 |
! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4880 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4881 |
socketTypeCodeOf:aSymbolOrInteger |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4882 |
"return the numeric SOCK_xxx code of a given symbolic socket type name. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4883 |
Return nil for invalid or unsupported socket types." |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4884 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4885 |
|typeCode| |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4886 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4887 |
%{ /*NOCONTEXT*/ |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4888 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4889 |
if (__isSmallInteger(aSymbolOrInteger) || aSymbolOrInteger == nil) { |
7711 | 4890 |
typeCode = aSymbolOrInteger; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4891 |
} |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4892 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4893 |
#ifdef SOCK_STREAM |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4894 |
else if ((aSymbolOrInteger == @symbol(stream)) || (aSymbolOrInteger == @symbol(SOCK_STREAM))) |
8913 | 4895 |
typeCode = __mkSmallInteger(SOCK_STREAM); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4896 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4897 |
#ifdef SOCK_DGRAM |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4898 |
else if ((aSymbolOrInteger == @symbol(datagram)) || (aSymbolOrInteger == @symbol(SOCK_DGRAM))) |
8913 | 4899 |
typeCode = __mkSmallInteger(SOCK_DGRAM); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4900 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4901 |
#ifdef SOCK_RAW |
8669 | 4902 |
else if ((aSymbolOrInteger == @symbol(raw)) || (aSymbolOrInteger == @symbol(SOCK_RAW))) |
8913 | 4903 |
typeCode = __mkSmallInteger(SOCK_RAW); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4904 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4905 |
#ifdef SOCK_RDM |
8669 | 4906 |
else if ((aSymbolOrInteger == @symbol(rdm)) || (aSymbolOrInteger == @symbol(SOCK_RDM))) |
8913 | 4907 |
typeCode = __mkSmallInteger(SOCK_RDM); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4908 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4909 |
#ifdef SOCK_SEQPACKET |
8669 | 4910 |
else if ((aSymbolOrInteger == @symbol(seqpacket)) || (aSymbolOrInteger == @symbol(SOCK_SEQPACKET))) |
8913 | 4911 |
typeCode = __mkSmallInteger(SOCK_SEQPACKET); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4912 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4913 |
#ifdef SOCK_PACKET |
8669 | 4914 |
else if ((aSymbolOrInteger == @symbol(packet)) || (aSymbolOrInteger == @symbol(SOCK_PACKET))) |
8913 | 4915 |
typeCode = __mkSmallInteger(SOCK_PACKET); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4916 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4917 |
%}. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4918 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4919 |
^ typeCode. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4920 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4921 |
" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4922 |
self socketTypeCodeOf:#stream |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4923 |
self socketTypeCodeOf:#datagram |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4924 |
self socketTypeCodeOf:#raw |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4925 |
" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4926 |
! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4927 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4928 |
socketTypeSymbolOf:anInteger |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4929 |
"return the symbolic typeName of a given numeric SOCK_xxx socket type code. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4930 |
Return nil for invalid or unsupported socket types." |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4931 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4932 |
|socketTypeSymbol| |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4933 |
|
8669 | 4934 |
%{ /*NOCONTEXT*/ |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4935 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4936 |
if (__isSmallInteger(anInteger)) { |
7711 | 4937 |
switch(__intVal(anInteger)) { |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4938 |
#ifdef SOCK_STREAM |
7711 | 4939 |
case SOCK_STREAM: |
4940 |
socketTypeSymbol = @symbol(SOCK_STREAM); |
|
4941 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4942 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4943 |
#ifdef SOCK_DGRAM |
7711 | 4944 |
case SOCK_DGRAM: |
4945 |
socketTypeSymbol = @symbol(SOCK_DGRAM); |
|
4946 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4947 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4948 |
#ifdef SOCK_RAW |
7711 | 4949 |
case SOCK_RAW: |
4950 |
socketTypeSymbol = @symbol(SOCK_RAW); |
|
4951 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4952 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4953 |
#ifdef SOCK_RDM |
7711 | 4954 |
case SOCK_RDM: |
4955 |
socketTypeSymbol = @symbol(SOCK_RDM); |
|
4956 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4957 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4958 |
#ifdef SOCK_SEQPACKET |
7711 | 4959 |
case SOCK_SEQPACKET: |
4960 |
socketTypeSymbol = @symbol(SOCK_SEQPACKET); |
|
4961 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4962 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4963 |
#ifdef SOCK_PACKET |
7711 | 4964 |
case SOCK_PACKET: |
4965 |
socketTypeSymbol = @symbol(SOCK_PACKET); |
|
4966 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4967 |
#endif |
7711 | 4968 |
} |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4969 |
} |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4970 |
%}. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4971 |
^ socketTypeSymbol. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4972 |
! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4973 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4974 |
supportedProtocolFamilies |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4975 |
"return a collection of supported protocol families. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4976 |
This list specifies what the Socket class supports - |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4977 |
socket creation may still fail, if your system was built without it. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4978 |
For backward compatibility, the returned list includes the old |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4979 |
(non-AF-prefixed) symbols; these will vanish." |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4980 |
|
7713 | 4981 |
^ #( |
4982 |
#AF_INET #inet |
|
4983 |
#AF_UNIX #unix |
|
4984 |
#AF_INET6 #inet6 |
|
4985 |
#AF_APPLETALK #appletalk |
|
4986 |
#AF_DECnet #decnet |
|
8669 | 4987 |
#AF_NS #ns |
4988 |
#AF_X25 #x25 |
|
4989 |
#AF_SNA |
|
4990 |
#AF_RAW |
|
4991 |
#AF_ISO |
|
8784 | 4992 |
#AF_ECMA |
8669 | 4993 |
#AF_NETBIOS #netbios |
4994 |
#AF_IPX |
|
4995 |
#AF_AX25 |
|
4996 |
#AF_NETROM |
|
4997 |
#AF_BRIDGE |
|
4998 |
#AF_BSC |
|
4999 |
#AF_ROSE |
|
5000 |
#AF_IRDA #irda |
|
5001 |
#AF_NETLINK |
|
8784 | 5002 |
#AF_NETLINK |
8669 | 5003 |
#AF_NETBEUI |
5004 |
#AF_ATM |
|
5005 |
#AF_ATMPVC |
|
7713 | 5006 |
#AF_ATMSVC |
5007 |
#AF_BAN |
|
5008 |
#AF_VOICEVIEW |
|
7716 | 5009 |
#AF_ECONET |
5010 |
#AF_IMPLINK |
|
8784 | 5011 |
#AF_PUP |
7716 | 5012 |
#AF_CHAOS |
5013 |
#AF_DLI |
|
5014 |
#AF_LAT |
|
5015 |
#AF_HYLINK |
|
5016 |
#AF_FIREFOX |
|
5017 |
#AF_CLUSTER |
|
5018 |
#AF_12844 |
|
5019 |
#AF_NETDES |
|
8669 | 5020 |
) select:[:sym | (AbstractOperatingSystem domainCodeOf:sym) isNumber ] |
5021 |
||
5022 |
" |
|
5023 |
AbstractOperatingSystem supportedProtocolFamilies |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5024 |
" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5025 |
! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5026 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5027 |
supportedSocketTypes |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5028 |
"return the symbolic typeName of a given numeric SOCK_xxx socket type code. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5029 |
Return nil for invalid or unsupported socket types." |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5030 |
|
7713 | 5031 |
^ #( |
5032 |
#SOCK_STREAM |
|
5033 |
#SOCK_DGRAM |
|
5034 |
#SOCK_RAW |
|
5035 |
#SOCK_RDM |
|
5036 |
#SOCK_SEQPACKET |
|
8669 | 5037 |
#SOCK_PACKET |
5038 |
) select:[:sym | (AbstractOperatingSystem socketTypeCodeOf:sym) isNumber ] |
|
7713 | 5039 |
|
5040 |
" |
|
5041 |
AbstractOperatingSystem supportedSocketTypes |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5042 |
" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5043 |
! ! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5044 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5045 |
!AbstractOperatingSystem class methodsFor:'shared memory access'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5046 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5047 |
shmAttach:id address:addr flags:flags |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5048 |
"low level entry to shmat()-system call. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5049 |
Not supported on all operatingSystems" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5050 |
|
4204 | 5051 |
^ UnsupportedOperationSignal raise |
5052 |
||
5053 |
"Modified: / 19.5.1999 / 14:21:35 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5054 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5055 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5056 |
shmDetach:addr |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5057 |
"low level entry to shmdt()-system call. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5058 |
Not supported on all operatingSystems" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5059 |
|
4204 | 5060 |
^ UnsupportedOperationSignal raise |
5061 |
||
5062 |
"Modified: / 19.5.1999 / 14:21:37 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5063 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5064 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5065 |
shmGet:key size:size flags:flags |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5066 |
"low level entry to shmget()-system call. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5067 |
This is not for public use and not supported with all operatingSystems. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5068 |
- use the provided wrapper class SharedExternalBytes instead." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5069 |
|
4204 | 5070 |
^ UnsupportedOperationSignal raise |
5071 |
||
5072 |
"Modified: / 19.5.1999 / 14:21:41 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5073 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5074 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5075 |
!AbstractOperatingSystem class methodsFor:'time and date'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5076 |
|
8565
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5077 |
computeDatePartsOf:osTime for:aBlock |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5078 |
"compute year, month and day from the OS time, osTime |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5079 |
and evaluate the argument, a 3-arg block with these. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5080 |
Conversion is to localtime including any daylight saving adjustments." |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5081 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5082 |
<resource:#obsolete> |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5083 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5084 |
|i| |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5085 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5086 |
self obsoleteMethodWarning:'use #computeTimeAndDateFrom:osTime'. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5087 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5088 |
i := self computeTimeAndDateFrom:osTime. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5089 |
aBlock value:i year value:i month value:i day |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5090 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5091 |
" |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5092 |
OperatingSystem computeDatePartsOf:0 for:[:y :m :d | |
8669 | 5093 |
y printCR. m printCR. d printCR |
8565
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5094 |
] |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5095 |
" |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5096 |
! |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5097 |
|
4377
59bb21ad2839
New method to compute Time form UTC.
Stefan Vogel <sv@exept.de>
parents:
4240
diff
changeset
|
5098 |
computeOSTimeFromUTCYear:y month:m day:d hour:h minute:min second:s millisecond:millis |
8669 | 5099 |
"return the OS-dependent time for the given time and day. |
4377
59bb21ad2839
New method to compute Time form UTC.
Stefan Vogel <sv@exept.de>
parents:
4240
diff
changeset
|
5100 |
The arguments are assumed to be in UTC Time" |
59bb21ad2839
New method to compute Time form UTC.
Stefan Vogel <sv@exept.de>
parents:
4240
diff
changeset
|
5101 |
|
59bb21ad2839
New method to compute Time form UTC.
Stefan Vogel <sv@exept.de>
parents:
4240
diff
changeset
|
5102 |
self subclassResponsibility |
59bb21ad2839
New method to compute Time form UTC.
Stefan Vogel <sv@exept.de>
parents:
4240
diff
changeset
|
5103 |
|
59bb21ad2839
New method to compute Time form UTC.
Stefan Vogel <sv@exept.de>
parents:
4240
diff
changeset
|
5104 |
"Created: / 13.7.1999 / 12:44:03 / stefan" |
59bb21ad2839
New method to compute Time form UTC.
Stefan Vogel <sv@exept.de>
parents:
4240
diff
changeset
|
5105 |
! |
59bb21ad2839
New method to compute Time form UTC.
Stefan Vogel <sv@exept.de>
parents:
4240
diff
changeset
|
5106 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5107 |
computeOSTimeFromYear:y month:m day:d hour:h minute:min seconds:s millis:millis |
8669 | 5108 |
"return the OS-dependent time for the given time and day. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5109 |
The arguments are assumed to be in localtime including |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5110 |
any daylight saving adjustings." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5111 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5112 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5113 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5114 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5115 |
computeTimeAndDateFrom:osTime |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5116 |
"given an OS-dependent time in osTime, return an Array |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5117 |
containing (full-) year, month, day, hour, minute and seconds, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5118 |
offset to UTC, daylight savings time flag, milliseconds, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5119 |
dayInYear (1..) and dayInWeek (1..). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5120 |
Conversion is to localtime including any daylight saving adjustments." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5121 |
|
7733 | 5122 |
|divMod ret| |
5123 |
||
5124 |
divMod := osTime divMod:1000. |
|
7739
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
5125 |
ret := self timeInfoFromSeconds:(divMod at:1) milliseconds:(divMod at:2) localTime:true. |
7514 | 5126 |
^ ret |
5127 |
||
5128 |
" |
|
5129 |
OperatingSystem computeTimeAndDateFrom:0 |
|
5130 |
OperatingSystem computeTimeAndDateFrom:1011 |
|
5131 |
" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5132 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5133 |
|
8565
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5134 |
computeTimePartsOf:osTime for:aBlock |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5135 |
"compute hours, minutes, seconds and milliseconds from the local osTime |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5136 |
and evaluate the argument, a 4-arg block with these. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5137 |
Conversion is to localtime including any daylight saving adjustments." |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5138 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5139 |
<resource:#obsolete> |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5140 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5141 |
|hours minutes seconds millis i| |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5142 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5143 |
self obsoleteMethodWarning:'use #computeTimeAndDateFrom:osTime'. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5144 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5145 |
i := self computeTimeAndDateFrom:osTime. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5146 |
hours := i hours. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5147 |
minutes := i minutes. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5148 |
seconds := i seconds. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5149 |
millis := i milliseconds. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5150 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5151 |
aBlock value:hours value:minutes value:seconds value:millis |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5152 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5153 |
" |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5154 |
OperatingSystem computeTimePartsOf:100 for:[:h :m :s :milli | |
8669 | 5155 |
Transcript show:h; space; show:m; space; show:s; space; showCR:milli. |
8565
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5156 |
] |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5157 |
" |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5158 |
! |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5159 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5160 |
computeUTCTimeAndDateFrom:osTime |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5161 |
"given an OS-dependent time in osTime, return an Array |
7514 | 5162 |
containing: |
8669 | 5163 |
(full-) year, |
5164 |
month, (1..) |
|
5165 |
day, (1..) |
|
5166 |
hour, (0..23) |
|
5167 |
minute (0..59) |
|
5168 |
seconds, (0..59) |
|
5169 |
offset to UTC, (seconds) |
|
5170 |
daylight savings time flag, |
|
5171 |
milliseconds, (0..999) |
|
5172 |
dayInYear (1..) |
|
5173 |
dayInWeek (1..). |
|
7514 | 5174 |
Conversion is to utc." |
5175 |
||
7733 | 5176 |
|divMod ret| |
5177 |
||
5178 |
divMod := osTime divMod:1000. |
|
7739
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
5179 |
ret := self timeInfoFromSeconds:(divMod at:1) milliseconds:(divMod at:2) localTime:false. |
7514 | 5180 |
^ ret |
5181 |
||
5182 |
" |
|
8669 | 5183 |
OperatingSystem computeUTCTimeAndDateFrom:0 |
7514 | 5184 |
OperatingSystem computeUTCTimeAndDateFrom:1011 |
5185 |
" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5186 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5187 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5188 |
computeUTCTimePartsOf:osTime for:aBlock |
8565
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5189 |
"compute hours, minutes, seconds and milliseconds from the osTime |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5190 |
and evaluate the argument, a 4-arg block with these. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5191 |
Conversion is to UTC." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5192 |
|
8565
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5193 |
<resource:#obsolete> |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5194 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5195 |
|hours minutes seconds millis i| |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5196 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5197 |
self obsoleteMethodWarning:'use #computeTimeAndDateFrom:osTime'. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5198 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5199 |
i := self computeUTCTimeAndDateFrom:osTime. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5200 |
hours := i hours. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5201 |
minutes := i minutes. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5202 |
seconds := i seconds. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5203 |
millis := i milliseconds. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5204 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5205 |
aBlock value:hours value:minutes value:seconds value:millis |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5206 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5207 |
|
3689
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5208 |
getMicrosecondTime |
8669 | 5209 |
"This returns the microsecond timers value - if available. |
3689
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5210 |
On some machines, times with this precision may not be available, |
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5211 |
on those, the returned value may be rounded towards some internal |
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5212 |
clock resolution value." |
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5213 |
|
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5214 |
"/ fallBack - use getMillisecondTime, which must be implemented |
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5215 |
"/ for all OS's |
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5216 |
|
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5217 |
^ self getMillisecondTime * 1000 |
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5218 |
|
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5219 |
"Created: / 30.7.1998 / 16:38:26 / cg" |
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5220 |
! |
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5221 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5222 |
getMillisecondTime |
8669 | 5223 |
"This returns the millisecond timers value. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5224 |
The range is limited to 0..1fffffff (i.e. the SmallInteger range) to avoid |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5225 |
LargeInteger arithmetic when doing timeouts and delays. |
8669 | 5226 |
Since this value is wrapping around in regular intervals, this can only be used for |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5227 |
short relative time deltas. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5228 |
Use the millisecondTimeXXX:-methods to compare and add time deltas - these know about the wrap. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5229 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5230 |
BAD DESIGN: |
7711 | 5231 |
This should be changed to return some instance of RelativeTime, |
5232 |
and these computations moved there. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5233 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5234 |
Dont use this method in application code since it is an internal (private) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5235 |
interface. For compatibility with ST-80, use Time millisecondClockValue. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5236 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5237 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5238 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5239 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5240 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5241 |
getOSTime |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5242 |
"This returns the OS time. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5243 |
The base of the returned value is not consistent across |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5244 |
different OS's - some return the number of millis since jan, 1st 1970; |
8669 | 5245 |
others since 1900. The Time classes are prepared for this, and |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5246 |
converts as appropriate (by using my fromOSTime: conversion methods). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5247 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5248 |
Dont use this method in application code since it is an internal (private) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5249 |
interface. For compatibility with ST-80, use Time>>millisecondClockValue. |
8250
83c16e036200
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8236
diff
changeset
|
5250 |
or use instances of Time, Date or Timestamp to work with. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5251 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5252 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5253 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5254 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5255 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5256 |
maximumMillisecondTimeDelta |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5257 |
"this returns the maximum delta supported by millisecondCounter |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5258 |
based methods. The returned value is half the value at which the |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5259 |
timer wraps." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5260 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5261 |
%{ /* NOCONTEXT */ |
8913 | 5262 |
RETURN ( __mkSmallInteger(0x0FFFFFFF) ); |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5263 |
%} |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5264 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5265 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5266 |
millisecondDelay:millis |
7681
7c63f0b47f0d
oops: millisecondDelay: was duplicated
Claus Gittinger <cg@exept.de>
parents:
7656
diff
changeset
|
5267 |
"delay execution for millis milliseconds or until the next event arrives. |
8669 | 5268 |
All other threads proceed as usual. |
7849 | 5269 |
Better use a Delay, however, a delay cannot be used in the event handler or scheduler." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5270 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5271 |
|now then delta| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5272 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5273 |
now := self getMillisecondTime. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5274 |
then := self millisecondTimeAdd:now and:millis. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5275 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5276 |
[self millisecondTime:then isAfter:now] whileTrue:[ |
8669 | 5277 |
delta := self millisecondTimeDeltaBetween:then and:now. |
5278 |
self selectOnAnyReadable:nil writable:nil exception:nil withTimeOut:delta. |
|
5279 |
now := self getMillisecondTime. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5280 |
] |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5281 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5282 |
" |
7849 | 5283 |
OperatingSystem millisecondDelay:5000 |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5284 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5285 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5286 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5287 |
millisecondTime:msTime1 isAfter:msTime2 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5288 |
"return true if msTime1 is after msTime2, false if not. |
8669 | 5289 |
The two arguments are supposed to be millisecond times |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5290 |
(such as returned getMillisecondTime) which wrap at 16r1FFFFFFF. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5291 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5292 |
This should really be moved to some RelativeTime class." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5293 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5294 |
(msTime1 > msTime2) ifTrue:[ |
7711 | 5295 |
((msTime1 - msTime2) >= 16r10000000) ifTrue:[ |
5296 |
^ false |
|
5297 |
]. |
|
5298 |
^ true |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5299 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5300 |
((msTime2 - msTime1) > 16r10000000) ifTrue:[ |
7711 | 5301 |
^ true |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5302 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5303 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5304 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5305 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5306 |
millisecondTimeAdd:msTime1 and:msTime2 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5307 |
"Add two millisecond times (such as returned getMillisecondTime). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5308 |
The returned value is msTime1 + msTime2 where a wrap occurs at:16r1FFFFFFF. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5309 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5310 |
This should really be moved to some RelativeTime class." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5311 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5312 |
|sum| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5313 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5314 |
sum := msTime1 + msTime2. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5315 |
(sum > 16r1FFFFFFF) ifTrue:[^ sum - 16r20000000]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5316 |
(sum < 0) ifTrue:[^ sum + 16r20000000]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5317 |
^ sum |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5318 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5319 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5320 |
millisecondTimeDeltaBetween:msTime1 and:msTime2 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5321 |
"subtract two millisecond times (such as returned getMillisecondTime) |
8669 | 5322 |
and return the difference. Since milli-times wrap (at 16r01FFFFFFF), |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5323 |
some special handling is built-in here. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5324 |
The returned value is msTime1 - msTime2. The returned value is invalid |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5325 |
if the delta is >= 0x10000000. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5326 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5327 |
This should really be moved to some RelativeTime class; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5328 |
better yet: create a subclass of Integer named LimitedRangeInteger." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5329 |
|
8808
40ccab1cd68f
millisecondTimeDelltBetween: handle 0 millis between
Claus Gittinger <cg@exept.de>
parents:
8804
diff
changeset
|
5330 |
(msTime1 >= msTime2) ifTrue:[ |
40ccab1cd68f
millisecondTimeDelltBetween: handle 0 millis between
Claus Gittinger <cg@exept.de>
parents:
8804
diff
changeset
|
5331 |
^ msTime1 - msTime2 |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5332 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5333 |
^ msTime1 + 16r10000000 - msTime2 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5334 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5335 |
" |
8669 | 5336 |
OperatingSystem millisecondTimeAdd:16r0FFFFFFF and:1 |
5337 |
OperatingSystem millisecondTimeAdd:16r0FFFFFFF and:(16 / 3) |
|
5338 |
OperatingSystem millisecondTimeAdd:16r0FFFFFFF and:1000 |
|
5339 |
||
5340 |
OperatingSystem millisecondTimeDeltaBetween:0 and:16r0FFFFFFF |
|
5341 |
OperatingSystem millisecondTimeDeltaBetween:(13/3) and:16r0FFFFFFF |
|
5342 |
OperatingSystem millisecondTimeDeltaBetween:999 and:16r0FFFFFFF |
|
5343 |
||
5344 |
OperatingSystem millisecondTime:0 isAfter:16r0FFFFFFF |
|
5345 |
OperatingSystem millisecondTime:(13/3) isAfter:16r0FFFFFFF |
|
5346 |
OperatingSystem millisecondTime:999 isAfter:16r0FFFFFFF |
|
5347 |
||
5348 |
OperatingSystem millisecondTime:0 isAfter:0 |
|
5349 |
OperatingSystem millisecondTime:(13/3) isAfter:0 |
|
5350 |
OperatingSystem millisecondTime:999 isAfter:0 |
|
5351 |
||
5352 |
OperatingSystem millisecondTime:1 isAfter:0 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5353 |
OperatingSystem millisecondTime:(13/3) isAfter:2 |
8669 | 5354 |
OperatingSystem millisecondTime:999 isAfter:900 |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5355 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5356 |
|t1 t2| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5357 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5358 |
t1 := Time millisecondClockValue. |
8669 | 5359 |
(Delay forMilliseconds:1) wait. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5360 |
t2 := Time millisecondClockValue. |
8669 | 5361 |
OperatingSystem millisecondTimeDeltaBetween:t2 and:t1 |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5362 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5363 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5364 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5365 |
sleep:numberOfSeconds |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5366 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5367 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5368 |
"cease ANY action for some time. This suspends the whole smalltalk |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5369 |
(unix-) process for some time. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5370 |
Not really useful since not even low-prio processes and interrupt |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5371 |
handling will run during the sleep. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5372 |
Use either OperatingSystem>>millisecondDelay: (which makes all |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5373 |
threads sleep, but handles interrupts) or use a Delay (which makes |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5374 |
only the calling thread sleep)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5375 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5376 |
self subclassResponsibility |
7514 | 5377 |
! |
5378 |
||
5379 |
timeInfoClass |
|
5380 |
^ TimeInfo |
|
5381 |
! |
|
5382 |
||
5383 |
timeInfoFromSeconds:osSeconds localTime:isLocalTime |
|
5384 |
"return a timeInfo structure containing values for the given OS-second value. |
|
5385 |
An internal helper" |
|
5386 |
||
7739
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
5387 |
^ self timeInfoFromSeconds:osSeconds milliseconds:0 localTime:isLocalTime |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
5388 |
! |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
5389 |
|
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
5390 |
timeInfoFromSeconds:osSeconds milliseconds:osMilliSeconds localTime:isLocalTime |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
5391 |
"return a timeInfo structure containing values for the given OS-second value. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
5392 |
An internal helper" |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
5393 |
|
7514 | 5394 |
self subclassResponsibility |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5395 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5396 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5397 |
!AbstractOperatingSystem class methodsFor:'users & groups'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5398 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5399 |
getEffectiveGroupID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5400 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5401 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5402 |
"return the current users (thats you) effective numeric group id. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5403 |
This is only different from getGroupID, if you have ST/X running |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5404 |
as a setuid program (of which you should think about twice)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5405 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5406 |
^ self getGroupID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5407 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5408 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5409 |
OperatingSystem getEffectiveGroupID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5410 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5411 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5412 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5413 |
getEffectiveUserID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5414 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5415 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5416 |
"return the current users (thats you) effective numeric user id. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5417 |
This is only different from getUserID, if you have ST/X running |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5418 |
as a setuid program (of which you should think about twice)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5419 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5420 |
^ self getUserID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5421 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5422 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5423 |
OperatingSystem getEffectiveUserID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5424 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5425 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5426 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5427 |
getFullUserName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5428 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5429 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5430 |
"return a string with the users full name (thats you) - if available. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5431 |
If not, return the login name as a fallBack." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5432 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5433 |
^ self getFullUserNameFromID:(self getUserID) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5434 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5435 |
" |
8669 | 5436 |
OperatingSystem getFullUserName |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5437 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5438 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5439 |
"Modified: 24.1.1997 / 11:31:55 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5440 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5441 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5442 |
getFullUserNameFromID:userID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5443 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5444 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5445 |
"return a string with the users full name - if available. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5446 |
If not, return the login name as a fallBack." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5447 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5448 |
^ self getUserNameFromID:userID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5449 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5450 |
" |
8669 | 5451 |
OperatingSystem getFullUserNameFromID:0 |
5452 |
OperatingSystem getFullUserNameFromID:(OperatingSystem getUserID) |
|
5453 |
||
5454 |
OperatingSystem getUserNameFromID:(OperatingSystem getUserID) |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5455 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5456 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5457 |
"Modified: 15.7.1996 / 12:44:21 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5458 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5459 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5460 |
getGroupID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5461 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5462 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5463 |
"return the current users (thats you) numeric group id" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5464 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5465 |
^ 1 "/ just a dummy for systems which do not have userIDs |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5466 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5467 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5468 |
OperatingSystem getGroupID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5469 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5470 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5471 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5472 |
getGroupNameFromID:aNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5473 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5474 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5475 |
"return the group-name-string for a given numeric group-id" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5476 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5477 |
^ '???' "/ just a dummy for systems which do not have groups |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5478 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5479 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5480 |
OperatingSystem getGroupNameFromID:0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5481 |
OperatingSystem getGroupNameFromID:10 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5482 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5483 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5484 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5485 |
getHomeDirectory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5486 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5487 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5488 |
"return the name of the users home directory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5489 |
(i.e. yours)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5490 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5491 |
^ self getEnvironment:'HOME' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5492 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5493 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5494 |
OperatingSystem getHomeDirectory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5495 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5496 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5497 |
"Modified: 24.1.1997 / 11:32:13 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5498 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5499 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5500 |
getLoginName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5501 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5502 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5503 |
"return a string with the users login name (thats yours)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5504 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5505 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5506 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5507 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5508 |
getUserID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5509 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5510 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5511 |
"return the current users (thats you) numeric user id" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5512 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5513 |
^ 1 "just a dummy for systems which do not have userIDs" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5514 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5515 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5516 |
OperatingSystem getUserID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5517 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5518 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5519 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5520 |
getUserNameFromID:aNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5521 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5522 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5523 |
"return the user-name-string for a given numeric user-id. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5524 |
This is the login name, not the fullName." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5525 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5526 |
"/ fallBack dummy |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5527 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5528 |
aNumber == self getUserID ifTrue:[ |
7711 | 5529 |
^ self getLoginName |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5530 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5531 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5532 |
^ '? (' , aNumber printString , ')' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5533 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5534 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5535 |
OperatingSystem getUserNameFromID:0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5536 |
OperatingSystem getUserNameFromID:100 |
8669 | 5537 |
OperatingSystem getUserNameFromID:9991 |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5538 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5539 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5540 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5541 |
userInfoOf:aNameOrID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5542 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5543 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5544 |
"return a dictionary filled with userinfo. The argument can be either |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5545 |
a string with the users name or its numeric id. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5546 |
Notice, that not all systems provide (all of) this info; |
8669 | 5547 |
DOS systems return nothing; |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5548 |
non-SYSV4 systems have no age/comment. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5549 |
Portable applications may want to check the systemType and NOT depend |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5550 |
on all keys to be present in the returned dictionary. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5551 |
Another notice: on some systems (SYSV4), the gecos field includes multiple |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5552 |
entries (i.e. not just the name), separated by commas. You may want to |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5553 |
extract any substring, up to the first comma to get the real life name." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5554 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5555 |
|info| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5556 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5557 |
"/ fallBack dummy |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5558 |
info := IdentityDictionary new. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5559 |
info at:#name put:(self getLoginName). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5560 |
info at:#dir put:(self getHomeDirectory). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5561 |
^ info |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5562 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5563 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5564 |
OperatingSystem userInfoOf:'root' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5565 |
OperatingSystem userInfoOf:1 |
8669 | 5566 |
OperatingSystem userInfoOf:'claus' |
5567 |
OperatingSystem userInfoOf:'fooBar' |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5568 |
OperatingSystem userInfoOf:(OperatingSystem getUserID) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5569 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5570 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5571 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5572 |
!AbstractOperatingSystem class methodsFor:'waiting for events'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5573 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5574 |
blockingChildProcessWait |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5575 |
"return true, if childProcessWait: blocks, if no children are ready. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5576 |
On those systems, we must be somewhat careful when looking out for |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5577 |
a subprocesses status (to avoid blocking)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5578 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5579 |
^ true |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5580 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5581 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5582 |
childProcessWait:blocking pid:pidToWait |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5583 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5584 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5585 |
"get status changes from child processes. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5586 |
Return an OSProcessStatus or nil, if no process has terminated. |
8669 | 5587 |
If blocking is true, we wait until a process changed state, |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5588 |
otherwise we return immediately. |
8669 | 5589 |
Note that win32 needs to know the HANDLE of the process on which |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5590 |
it waits. In case of an error, THIS ALWAYS WAITS and then times out." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5591 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5592 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5593 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5594 |
|
7802 | 5595 |
isBlockingOn:fd |
5596 |
"{ Pragma: +optSpace }" |
|
5597 |
||
5598 |
"return the blocking attribute - if set (which is the default) |
|
5599 |
a read on the fileDescriptor will block until data is available. |
|
5600 |
If clear, a read operation will immediately return with a value nil. |
|
5601 |
Also affects write operations, which may perform partial writes when |
|
5602 |
blocking is off" |
|
5603 |
||
5604 |
self subclassResponsibility |
|
5605 |
! |
|
5606 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5607 |
numAvailableForReadOn:fd |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5608 |
"return the number of bytes available for reading, without blocking." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5609 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5610 |
"/ fallBack for systems which do not provide this info |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5611 |
^ (self readCheck:fd) ifTrue:[1] ifFalse:[0] |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5612 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5613 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5614 |
readCheck:fd |
8669 | 5615 |
"return true, if data is available on a filedescriptor |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5616 |
(i.e. read is possible without blocking). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5617 |
This depends on a working select or FIONREAD to be provided by the OS." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5618 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5619 |
self supportsSelect ifFalse:[ |
7711 | 5620 |
"/ mhmh - what should we do then ? |
5621 |
"/ For now, return true as if data was present, |
|
5622 |
"/ and let the thread fall into the read. |
|
5623 |
"/ It will then (hopefully) be descheduled there and |
|
5624 |
"/ effectively polling for input. |
|
5625 |
||
5626 |
^ true |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5627 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5628 |
|
7683 | 5629 |
^ (self selectOnAnyReadable:(Array with:fd) |
7711 | 5630 |
writable:nil |
5631 |
exception:nil |
|
5632 |
withTimeOut:0) == fd |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5633 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5634 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5635 |
readWriteCheck:fd |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5636 |
"return true, if filedescriptor can be read or written without blocking. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5637 |
This is actually only used with sockets, to wait for a connect to |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5638 |
be finished." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5639 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5640 |
self supportsSelect ifFalse:[ |
7711 | 5641 |
"/ mhmh - what should we do then ? |
5642 |
"/ For now, return true as if data was present, |
|
5643 |
"/ and let the thread fall into the write. |
|
5644 |
"/ It will then (hopefully) be desceduled there and |
|
5645 |
"/ effectively polling for output. |
|
5646 |
^ true |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5647 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5648 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5649 |
(self selectOnAnyReadable:(Array with:fd) |
7711 | 5650 |
writable:(Array with:fd) |
5651 |
exception:nil |
|
5652 |
withTimeOut:0) == fd |
|
5653 |
ifTrue:[^ true]. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5654 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5655 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5656 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5657 |
selectOn:fd1 and:fd2 withTimeOut:millis |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5658 |
"wait for any fd to become ready; timeout after t milliseconds. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5659 |
A zero timeout-time will immediately return (i.e. poll). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5660 |
Return fd if i/o ok, nil if timed-out or interrupted. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5661 |
Obsolete: |
7711 | 5662 |
This is a leftover method and will vanish." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5663 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5664 |
^ self selectOnAnyReadable:(Array with:fd1 with:fd2) |
7711 | 5665 |
writable:(Array with:fd1 with:fd2) |
5666 |
exception:nil |
|
5667 |
withTimeOut:millis |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5668 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5669 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5670 |
selectOn:fd withTimeOut:millis |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5671 |
"wait for aFileDesriptor to become ready; timeout after t milliseconds. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5672 |
Return true, if i/o ok, false if timed-out or interrupted. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5673 |
With 0 as timeout argument, this can be used to check for availability |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5674 |
of read-data. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5675 |
Experimental." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5676 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5677 |
^ self selectOnAnyReadable:(Array with:fd) |
7711 | 5678 |
writable:(Array with:fd) |
5679 |
exception:nil |
|
5680 |
withTimeOut:millis |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5681 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5682 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5683 |
selectOnAny:fdArray withTimeOut:millis |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5684 |
"wait for any fd in fdArray (an Array of integers) to become ready; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5685 |
timeout after t milliseconds. An empty set will always wait. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5686 |
Return first ready fd if i/o ok, nil if timed-out or interrupted. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5687 |
Experimental." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5688 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5689 |
^ self selectOnAnyReadable:fdArray |
7711 | 5690 |
writable:fdArray |
5691 |
exception:nil |
|
5692 |
withTimeOut:millis |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5693 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5694 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5695 |
selectOnAnyReadable:fdArray withTimeOut:millis |
8669 | 5696 |
"wait for any fd in fdArray (an Array of integers) to become ready for |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5697 |
reading. Timeout after t milliseconds. An empty set will always wait. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5698 |
A zero timeout-time will immediately return (i.e. poll). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5699 |
Return first ready fd if i/o ok, nil if timed-out or interrupted. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5700 |
Experimental." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5701 |
|
8669 | 5702 |
^ self selectOnAnyReadable:fdArray |
5703 |
writable:nil |
|
7711 | 5704 |
exception:nil |
5705 |
withTimeOut:millis |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5706 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5707 |
|
8669 | 5708 |
selectOnAnyReadable:readFdArray writable:writeFdArray exception:exceptFdArray |
5709 |
readableInto:readableResultFdArray writableInto:writableResultFdArray |
|
7711 | 5710 |
exceptionInto:exceptionResultFdArray |
5711 |
withTimeOut:millis |
|
7510
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
5712 |
|
8669 | 5713 |
"wait for any fd in readFdArray (an Array of integers) to become ready for reading, |
5714 |
writeFdArray to become ready for writing, |
|
7510
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
5715 |
or exceptFdArray to arrive exceptional data (i.e. out-of-band data). |
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
5716 |
Timeout after t milliseconds or - if the timeout time is 0 - immediately.. |
7492
f2bf4935e7eb
New select for fair scheduling (not giving low filedescriptors
Stefan Vogel <sv@exept.de>
parents:
7488
diff
changeset
|
5717 |
Empty fd-sets will always wait. Zero time can be used to poll file- |
f2bf4935e7eb
New select for fair scheduling (not giving low filedescriptors
Stefan Vogel <sv@exept.de>
parents:
7488
diff
changeset
|
5718 |
descriptors (i.e. to check if I/O possible without blocking). |
7510
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
5719 |
The corresponding filedescriptors which are ready are returned in readableResultFdArray, |
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
5720 |
writableResultFdArray and exceptionResultFdArray respectively. |
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
5721 |
|
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
5722 |
Return the (overall) number of selected filedescriptors. |
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
5723 |
readableResultFdArray, writableResultFdArray and exceptionResultFdArray will |
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
5724 |
get a nil-value stored into the slot after the last valid fileDescriptor; |
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
5725 |
Thus, the caller can simply scan these arrays upTo the end or a nil value." |
7492
f2bf4935e7eb
New select for fair scheduling (not giving low filedescriptors
Stefan Vogel <sv@exept.de>
parents:
7488
diff
changeset
|
5726 |
|
f2bf4935e7eb
New select for fair scheduling (not giving low filedescriptors
Stefan Vogel <sv@exept.de>
parents:
7488
diff
changeset
|
5727 |
self subclassResponsibility |
f2bf4935e7eb
New select for fair scheduling (not giving low filedescriptors
Stefan Vogel <sv@exept.de>
parents:
7488
diff
changeset
|
5728 |
! |
f2bf4935e7eb
New select for fair scheduling (not giving low filedescriptors
Stefan Vogel <sv@exept.de>
parents:
7488
diff
changeset
|
5729 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5730 |
selectOnAnyReadable:readFdArray writable:writeFdArray exception:exceptFdArray withTimeOut:millis |
8669 | 5731 |
"wait for any fd in readFdArray (an Array of integers) to become ready for |
5732 |
reading, writeFdArray to become ready for writing, or exceptFdArray to |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5733 |
arrive exceptional data (i.e. out-of-band data). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5734 |
Timeout after t milliseconds or, if the timeout time is 0, immediately.. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5735 |
Empty fd-sets will always wait. Zero time can be used to poll file- |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5736 |
descriptors (i.e. to check if I/O possible without blocking). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5737 |
Return first ready fd if I/O ok, nil if timed-out or interrupted." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5738 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5739 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5740 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5741 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5742 |
setBlocking:aBoolean on:fd |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5743 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5744 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5745 |
"set/clear the blocking attribute - if set (which is the default) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5746 |
a read on the fileDescriptor will block until data is available. |
7803 | 5747 |
If cleared, a read operation will immediately return with a value of nil. |
5748 |
Also affects write operations, which may perform partial writes when |
|
5749 |
blocking is off" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5750 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5751 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5752 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5753 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5754 |
writeCheck:fd |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5755 |
"return true, if filedescriptor can be written without blocking" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5756 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5757 |
self supportsSelect ifFalse:[ |
7711 | 5758 |
"/ mhmh - what should we do then ? |
5759 |
"/ For now, return true as if data was present, |
|
5760 |
"/ and let the thread fall into the write. |
|
5761 |
"/ It will then (hopefully) be desceduled there and |
|
5762 |
"/ effectively polling for output. |
|
5763 |
^ true |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5764 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5765 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5766 |
(self selectOnAnyReadable:nil |
7711 | 5767 |
writable:(Array with:fd) |
5768 |
exception:nil |
|
5769 |
withTimeOut:0) == fd |
|
5770 |
ifTrue:[^ true]. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5771 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5772 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5773 |
|
9476 | 5774 |
!AbstractOperatingSystem::PrinterInfo class methodsFor:'constants'! |
5775 |
||
5776 |
paperSizeNameForNumber:aNumber |
|
5777 |
^ self paperSizeNumberToNameMapping at:aNumber |
|
5778 |
||
5779 |
" |
|
5780 |
self paperSizeNameForNumber:1 |
|
5781 |
" |
|
5782 |
||
5783 |
"Created: / 31-07-2006 / 15:35:36 / fm" |
|
5784 |
! |
|
5785 |
||
5786 |
paperSizeNameForNumber:aNumber ifAbsent: aBlock |
|
5787 |
^ self paperSizeNumberToNameMapping at:aNumber ifAbsent: aBlock |
|
5788 |
||
5789 |
" |
|
5790 |
self paperSizeNameForNumber:11212 ifAbsent: [nil] |
|
5791 |
" |
|
5792 |
||
5793 |
"Created: / 31-07-2006 / 15:35:36 / fm" |
|
5794 |
! |
|
5795 |
||
5796 |
paperSizeNames |
|
5797 |
|codes| |
|
5798 |
codes := self paperSizeNumberToNameTable values asSortedCollection:[:a :b | a < b]. |
|
5799 |
^codes collect:[:each | self paperSizeNameForNumber: each] |
|
5800 |
||
5801 |
"Created: / 31-07-2006 / 15:35:36 / fm" |
|
5802 |
! |
|
5803 |
||
5804 |
paperSizeNumberForName:aName |
|
5805 |
^ self paperSizeNumberToNameMapping at:aName |
|
5806 |
||
5807 |
" |
|
5808 |
self paperSizeNumberForName:'Letter, 8 1/2- by 11-inches' |
|
5809 |
" |
|
5810 |
||
5811 |
"Created: / 31-07-2006 / 15:35:37 / fm" |
|
5812 |
! |
|
5813 |
||
5814 |
paperSizeNumberToNameMapping |
|
5815 |
|d| |
|
5816 |
||
5817 |
d := self paperSizeNumberToNameTable. |
|
5818 |
||
5819 |
d keys copy do:[:k | d at:(d at:k) put:k]. |
|
5820 |
^ d. |
|
5821 |
||
5822 |
"Created: / 31-07-2006 / 15:35:37 / fm" |
|
5823 |
! |
|
5824 |
||
5825 |
paperSizeNumberToNameTable |
|
5826 |
||
5827 |
^Dictionary withKeysAndValues: |
|
5828 |
#( |
|
5829 |
'Letter, 8 1/2- by 11-inches' 1 "/ Letter |
|
5830 |
'Legal 8 1/2- by 14-inches' 5 "/ Legal |
|
5831 |
'10- by 14-inch sheet' 16 "/ 10x14 |
|
5832 |
'11- by 17-inch sheet' 17 "/ 11x17 |
|
5833 |
"/ '12X11' "/ Windows 98/Me, Windows NT 4.0 and later: 12- by 11-inch sheet |
|
5834 |
'A3 sheet, 297- by 420-millimeters' 8 "/ A3 |
|
5835 |
'A3 rotated sheet, 420- by 297-millimeters' 67 "/ A3_rotated |
|
5836 |
'A4 sheet, 210- by 297-millimeters' 9 "/ A4 |
|
5837 |
'A4 rotated sheet, 297- by 210-millimeters' 55 "/ A4_rotated |
|
5838 |
'A4 small sheet, 210- by 297-millimeters' 10 "/ A4 small |
|
5839 |
'A5 sheet, 148- by 210-millimeters' 11 "/ A5 |
|
5840 |
'A5 rotated sheet, 210- by 148-millimeters' 61 "/ A5 rotated |
|
5841 |
"/ 'a6' "/ Windows 98/Me, Windows NT 4.0 and later: A6 sheet, 105- by 148-millimeters |
|
5842 |
"/ 'a6_rotated' "/ Windows 98/Me, Windows NT 4.0 and later: A6 rotated sheet, 148- by 105-millimeters |
|
5843 |
'B4 sheet, 250- by 354-millimeters' 12 "/ B4 |
|
5844 |
"/ b4_jis_rotated Windows 98/Me, Windows NT 4.0 and later: B4 (JIS) rotated sheet, 364- by 257-millimeters |
|
5845 |
'B5 sheet, 182- by 257-millimeter paper' 13 "/ B5 |
|
5846 |
"/ b5_jis_rotated Windows 98/Me, Windows NT 4.0 and later: B5 (JIS) rotated sheet, 257- by 182-millimeters |
|
5847 |
"/ b6_jis Windows 98/Me, Windows NT 4.0 and later: B6 (JIS) sheet, 128- by 182-millimeters |
|
5848 |
"/ b6_jis_rotated Windows 98/Me, Windows NT 4.0 and later: B6 (JIS) rotated sheet, 182- by 128-millimeters |
|
5849 |
"/ csheet C Sheet, 17- by 22-inches |
|
5850 |
"/ dbl_japanese_postcard Windows 98/Me, Windows NT 4.0 and later: Double Japanese Postcard, 200- by 148-millimeters |
|
5851 |
"/ dbl_japanese_postcard_rotated Windows 98/Me, Windows NT 4.0 and later: Double Japanese Postcard Rotated, 148- by 200-millimeters |
|
5852 |
"/ dsheet D Sheet, 22- by 34-inches |
|
5853 |
'#9 Envelope, 3 7/8- by 8 7/8-inches' 19 "/ env_9 |
|
5854 |
'#10 Envelope, 4 1/8- by 9 1/2-inches' 20 "/ env_10 |
|
5855 |
'#11 Envelope, 4 1/2- by 10 3/8-inches' 21 "/ env_11 |
|
5856 |
'#12 Envelope, 4 3/4- by 11-inches' 22 "/ env_12 |
|
5857 |
'#14 Envelope, 5- by 11 1/2-inches' 23 "/ env_15 |
|
5858 |
'C5 Envelope, 162- by 229-millimeters' 28 "/ env_c5 |
|
5859 |
'C3 Envelope, 324- by 458-millimeters' 29 "/ env_c3 |
|
5860 |
'C4 Envelope, 229- by 324-millimeters' 30 "/ env_c4 |
|
5861 |
'C6 Envelope, 114- by 162-millimeters' 31 "/ env_c6 |
|
5862 |
'C65 Envelope, 114- by 229-millimeters' 32 "/ env_c65 |
|
5863 |
'B4 Envelope, 250- by 353-millimeters' 33 "/ env_b4 |
|
5864 |
'B5 Envelope, 176- by 250-millimeters' 34 "/ env_b5 |
|
5865 |
'B6 Envelope, 176- by 125-millimeters' 35 "/ env_b6 |
|
5866 |
'DL Envelope, 110- by 220-millimeters' 27 "/ env_dl |
|
5867 |
'Italy Envelope, 110- by 230-millimeters' 36 "/ env_italy |
|
5868 |
'Monarch Envelope, 3 7/8- by 7 1/2-inches' 37 "/ env_monarch |
|
5869 |
"/ env_personal 6 3/4 Envelope, 3 5/8- by 6 1/2-inches |
|
5870 |
"/ esheet E Sheet, 34- by 44-inches |
|
5871 |
"/ executive Executive, 7 1/4- by 10 1/2-inches |
|
5872 |
"/ fanfold_us US Std Fanfold, 14 7/8- by 11-inches |
|
5873 |
"/ fanfold_std_german German Std Fanfold, 8 1/2- by 12-inches |
|
5874 |
"/ fanfold_lgl_german German Legal Fanfold, 8 - by 13-inches |
|
5875 |
"/ folio Folio, 8 1/2- by 13-inch paper |
|
5876 |
"/ japanese_postcard_rotated Windows 98/Me, Windows NT 4.0 and later: Japanese Postcard Rotated, 148- by 100-millimeters |
|
5877 |
"/ jenv_chou3 Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Chou #3 |
|
5878 |
"/ jenv_chou3_rotated Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Chou #3 Rotated |
|
5879 |
"/ jenv_chou4 Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Chou #4 |
|
5880 |
"/ jenv_chou4_rotated Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Chou #4 Rotated |
|
5881 |
"/ jenv_kaku2 Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Kaku #2 |
|
5882 |
"/ jenv_kaku2_rotated Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Kaku #2 Rotated |
|
5883 |
"/ jenv_kaku3 Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Kaku #3 |
|
5884 |
"/ jenv_kaku3_rotated Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Kaku #3 Rotated |
|
5885 |
"/ jenv_you4 Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope You #4 |
|
5886 |
"/ jenv_you4_rotated Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope You #4 Rotated |
|
5887 |
"/ last Windows 2000/XP: PENV_10_ROTATED |
|
5888 |
'Ledger, 17- by 11-inches' 4 "/ ledger |
|
5889 |
'Letter Rotated 11 by 8 1/2 11 inches' 54 "/ letter_rotated |
|
5890 |
"/ lettersmall Letter Small, 8 1/2- by 11-inches |
|
5891 |
"/ note Note, 8 1/2- by 11-inches |
|
5892 |
"/ p16k Windows 98/Me, Windows NT 4.0 and later: PRC 16K, 146- by 215-millimeters |
|
5893 |
"/ p16k_rotated Windows 98/Me, Windows NT 4.0 and later: PRC 16K Rotated, 215- by 146-millimeters |
|
5894 |
"/ p32k Windows 98/Me, Windows NT 4.0 and later: PRC 32K, 97- by 151-millimeters |
|
5895 |
"/ p32k_rotated Windows 98/Me, Windows NT 4.0 and later: PRC 32K Rotated, 151- by 97-millimeters |
|
5896 |
"/ p32kbig Windows 98/Me, Windows NT 4.0 and later: PRC 32K(Big) 97- by 151-millimeters |
|
5897 |
"/ p32kbig_rotated Windows 98/Me, Windows NT 4.0 and later: PRC 32K(Big) Rotated, 151- by 97-millimeters |
|
5898 |
"/ penv_1 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #1, 102- by 165-millimeters |
|
5899 |
"/ penv_1_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #1 Rotated, 165- by 102-millimeters |
|
5900 |
"/ penv_2 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #2, 102- by 176-millimeters |
|
5901 |
"/ penv_2_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #2 Rotated, 176- by 102-millimeters |
|
5902 |
"/ penv_3 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #3, 125- by 176-millimeters |
|
5903 |
"/ penv_3_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #3 Rotated, 176- by 125-millimeters |
|
5904 |
"/ penv_4 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #4, 110- by 208-millimeters |
|
5905 |
"/ penv_4_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #4 Rotated, 208- by 110-millimeters |
|
5906 |
"/ penv_5 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #5, 110- by 220-millimeters |
|
5907 |
"/ penv_5_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #5 Rotated, 220- by 110-millimeters |
|
5908 |
"/ penv_6 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #6, 120- by 230-millimeters |
|
5909 |
"/ penv_6_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #6 Rotated, 230- by 120-millimeters |
|
5910 |
"/ penv_7 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #7, 160- by 230-millimeters |
|
5911 |
"/ penv_7_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #7 Rotated, 230- by 160-millimeters |
|
5912 |
"/ penv_8 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #8, 120- by 309-millimeters |
|
5913 |
"/ penv_8_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #8 Rotated, 309- by 120-millimeters |
|
5914 |
"/ penv_9 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #9, 229- by 324-millimeters |
|
5915 |
"/ penv_9_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #9 Rotated, 324- by 229-millimeters |
|
5916 |
"/ penv_10 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #10, 324- by 458-millimeters |
|
5917 |
"/ penv_10_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #10 Rotated, 458- by 324-millimeters |
|
5918 |
"/ quarto Quarto, 215- by 275-millimeter paper |
|
5919 |
"/ statement Statement, 5 1/2- by 8 1/2-inches |
|
5920 |
"/ tabloid Tabloid, 11- by 17-inches |
|
5921 |
). |
|
5922 |
||
5923 |
"Created: / 31-07-2006 / 15:35:37 / fm" |
|
5924 |
! |
|
5925 |
||
5926 |
statusNumberToDescriptionForNumber:aNumber |
|
5927 |
^ self statusNumberToDescriptionMapping at:aNumber ifAbsent:[aNumber printString] |
|
5928 |
||
5929 |
" |
|
5930 |
self statusNumberToDescriptionForNumber:1 |
|
5931 |
" |
|
5932 |
||
5933 |
"Created: / 01-08-2006 / 14:31:18 / fm" |
|
5934 |
! |
|
5935 |
||
5936 |
statusNumberToDescriptionMapping |
|
5937 |
|d| |
|
5938 |
||
5939 |
d := self statusNumberToDescriptionTable. |
|
5940 |
||
5941 |
d keys copy do:[:k | d at:(d at:k) put:k]. |
|
5942 |
^ d. |
|
5943 |
||
5944 |
"Created: / 01-08-2006 / 14:31:05 / fm" |
|
5945 |
! |
|
5946 |
||
5947 |
statusNumberToDescriptionTable |
|
5948 |
||
5949 |
^Dictionary withKeysAndValues: |
|
5950 |
#( 'Ready' 0 "/ PRINTER_STATUS_READY |
|
5951 |
'Paused' 1 "/ PRINTER_STATUS_PAUSED |
|
5952 |
'Error' 2 "/ PRINTER_STATUS_ERROR |
|
5953 |
'Deleting...' 4 "/ PRINTER_STATUS_PENDING_DELETION |
|
5954 |
'Paper Jam' 8 "/ PRINTER_STATUS_PAPER_JAM |
|
5955 |
'Paper Out' 16 "/ PRINTER_STATUS_PAPER_OUT |
|
5956 |
'Manual Feed Required' 32 "/ PRINTER_STATUS_MANUAL_FEED |
|
5957 |
'Paper Problem' 64 "/ PRINTER_STATUS_PAPER_PROBLEM |
|
5958 |
'Offline' 128 "/ PRINTER_STATUS_OFFLINE |
|
5959 |
'Downloading Job' 256 "/ PRINTER_STATUS_IO_ACTIVE |
|
5960 |
'Busy' 512 "/ PRINTER_STATUS_BUSY |
|
5961 |
'Printing' 1024 "/ PRINTER_STATUS_PRINTING |
|
5962 |
'Output Bill Full' 2048 "/ PRINTER_STATUS_OUTPUT_BIN_FULL |
|
5963 |
'Not Available' 4096 "/ PRINTER_STATUS_NOT_AVAILABLE |
|
5964 |
'Waiting' 8192 "/ PRINTER_STATUS_WAITING |
|
5965 |
'Processing Job' 16384 "/ PRINTER_STATUS_PROCESSING |
|
5966 |
'Initializing' 32768 "/ PRINTER_STATUS_INITIALIZING |
|
5967 |
'Warming Up' 65536 "/ PRINTER_STATUS_WARMING_UP |
|
5968 |
'Toner Low' 131072 "/ PRINTER_STATUS_TONER_LOW |
|
5969 |
'Toner Out' 262144 "/ PRINTER_STATUS_NO_TONER |
|
5970 |
'Page too Complex' 524288 "/ PRINTER_STATUS_PAGE_PUNT |
|
5971 |
'User Intervention Required'1048576 "/ PRINTER_STATUS_USER_INTERVENTION |
|
5972 |
'Out of Memory' 2097152 "/ PRINTER_STATUS_OUT_OF_MEMORY |
|
5973 |
'Door Open' 4194304 "/ PRINTER_STATUS_DOOR_OPEN |
|
5974 |
'Unable to connect' 8388608 "/ PRINTER_STATUS_SERVER_UNKNOWN |
|
5975 |
'Power Save Mode' 16777216 "/ PRINTER_STATUS_POWER_SAVE |
|
5976 |
). |
|
5977 |
||
5978 |
"Created: / 01-08-2006 / 14:23:33 / fm" |
|
5979 |
! ! |
|
5980 |
||
5981 |
!AbstractOperatingSystem::PrinterInfo methodsFor:'accessing'! |
|
5982 |
||
5983 |
attributes |
|
5984 |
^ attributes |
|
5985 |
||
5986 |
"Created: / 27-07-2006 / 12:16:59 / fm" |
|
5987 |
! |
|
5988 |
||
5989 |
collate |
|
5990 |
^self documentProperties collate = 1 |
|
5991 |
||
5992 |
"Created: / 01-08-2006 / 09:56:14 / fm" |
|
5993 |
"Modified: / 01-08-2006 / 11:49:18 / fm" |
|
5994 |
! |
|
5995 |
||
5996 |
collate: aBoolean |
|
5997 |
|integer| |
|
5998 |
integer:= aBoolean |
|
5999 |
ifTrue:[1] "DMCOLLATE_TRUE" |
|
6000 |
ifFalse:[0]. "DMCOLLATE_FALSE" |
|
6001 |
self documentProperties collate: integer |
|
6002 |
||
6003 |
"Created: / 01-08-2006 / 09:56:01 / fm" |
|
6004 |
! |
|
6005 |
||
6006 |
comment |
|
6007 |
||
6008 |
^self printerInfo2 pComment |
|
6009 |
||
6010 |
"Created: / 01-08-2006 / 15:06:20 / fm" |
|
6011 |
! |
|
6012 |
||
6013 |
copies |
|
6014 |
^self documentProperties copies |
|
6015 |
||
6016 |
"Created: / 31-07-2006 / 13:46:53 / fm" |
|
6017 |
! |
|
6018 |
||
6019 |
copies: anInteger |
|
6020 |
||
6021 |
self documentProperties copies: anInteger |
|
6022 |
||
6023 |
"Created: / 31-07-2006 / 13:54:55 / fm" |
|
6024 |
! |
|
6025 |
||
6026 |
documentProperties |
|
6027 |
||
6028 |
^documentProperties |
|
6029 |
||
6030 |
"Created: / 28-07-2006 / 11:50:04 / fm" |
|
6031 |
"Modified: / 31-07-2006 / 13:06:24 / fm" |
|
6032 |
! |
|
6033 |
||
6034 |
documentProperties: aDevModeStructure |
|
6035 |
||
6036 |
documentProperties := aDevModeStructure. |
|
6037 |
||
6038 |
"Created: / 28-07-2006 / 11:47:31 / fm" |
|
6039 |
! |
|
6040 |
||
6041 |
driverName |
|
6042 |
||
6043 |
^self attributes at:#driverName |
|
6044 |
||
6045 |
"Created: / 01-08-2006 / 15:33:08 / fm" |
|
6046 |
! |
|
6047 |
||
6048 |
location |
|
6049 |
||
6050 |
^self printerInfo2 pLocation |
|
6051 |
||
6052 |
"Created: / 01-08-2006 / 15:06:28 / fm" |
|
6053 |
! |
|
6054 |
||
6055 |
longName |
|
6056 |
^attributes at:#longName |
|
6057 |
ifAbsent:[''] |
|
6058 |
||
6059 |
"Created: / 28-07-2006 / 12:06:32 / fm" |
|
6060 |
! |
|
6061 |
||
6062 |
medium |
|
6063 |
||
6064 |
^self attributes at:#medium |
|
6065 |
||
6066 |
"Created: / 01-08-2006 / 15:34:26 / fm" |
|
6067 |
! |
|
6068 |
||
6069 |
orientation |
|
6070 |
^self documentProperties orientation |
|
6071 |
||
6072 |
"Created: / 28-07-2006 / 16:44:26 / fm" |
|
6073 |
! |
|
6074 |
||
6075 |
orientation: anInteger |
|
6076 |
^self documentProperties orientation: anInteger |
|
6077 |
||
6078 |
"Created: / 28-07-2006 / 17:22:44 / fm" |
|
6079 |
! |
|
6080 |
||
6081 |
pDriverName |
|
6082 |
||
6083 |
^self printerInfo2 pDriverName |
|
6084 |
||
6085 |
"Created: / 01-08-2006 / 15:33:08 / fm" |
|
6086 |
! |
|
6087 |
||
6088 |
paperSize |
|
6089 |
||
6090 |
^self documentProperties paperSize |
|
6091 |
||
6092 |
"Created: / 31-07-2006 / 15:23:29 / fm" |
|
6093 |
"Modified: / 31-07-2006 / 16:25:58 / fm" |
|
6094 |
! |
|
6095 |
||
6096 |
paperSize: anInteger |
|
6097 |
||
6098 |
self documentProperties paperSize: anInteger |
|
6099 |
||
6100 |
"Created: / 31-07-2006 / 15:23:20 / fm" |
|
6101 |
! |
|
6102 |
||
6103 |
paperSizeName |
|
6104 |
^ self class paperSizeNameForNumber:self paperSize ifAbsent:[nil]. |
|
6105 |
||
6106 |
"Created: / 31-07-2006 / 15:35:12 / fm" |
|
6107 |
! |
|
6108 |
||
6109 |
paperSizeName: aString |
|
6110 |
||
6111 |
self paperSize: (self class paperSizeNumberForName: aString) |
|
6112 |
||
6113 |
"Created: / 31-07-2006 / 16:07:03 / fm" |
|
6114 |
! |
|
6115 |
||
6116 |
printQuality |
|
6117 |
^self documentProperties printQuality |
|
6118 |
||
6119 |
"Created: / 04-08-2006 / 13:10:06 / fm" |
|
6120 |
! |
|
6121 |
||
6122 |
printerName |
|
6123 |
^ printerName |
|
6124 |
||
6125 |
"Created: / 27-07-2006 / 12:16:59 / fm" |
|
6126 |
! |
|
6127 |
||
6128 |
printerName:printerNameArg attributes:attributesArg |
|
6129 |
||
6130 |
printerName := printerNameArg. |
|
6131 |
attributes := attributesArg. |
|
6132 |
||
6133 |
"Created: / 27-07-2006 / 12:29:18 / fm" |
|
6134 |
! |
|
6135 |
||
6136 |
remotePrinterHost |
|
6137 |
^attributes at:#remotePrinterHost |
|
6138 |
ifAbsent:[''] |
|
6139 |
||
6140 |
"Created: / 28-07-2006 / 16:30:13 / fm" |
|
6141 |
! |
|
6142 |
||
6143 |
remotePrinterName |
|
6144 |
^attributes at:#remotePrinterName |
|
6145 |
ifAbsent:[''] |
|
6146 |
||
6147 |
"Created: / 28-07-2006 / 16:30:06 / fm" |
|
6148 |
! |
|
6149 |
||
6150 |
status |
|
6151 |
||
6152 |
self isAvailable ifFalse:[^'']. |
|
6153 |
^self class statusNumberToDescriptionForNumber: self getPrinterInfo2 status |
|
6154 |
||
6155 |
"Created: / 01-08-2006 / 13:48:58 / fm" |
|
6156 |
! |
|
6157 |
||
6158 |
userFriendlyName |
|
6159 |
^self remotePrinterName isEmpty |
|
6160 |
ifTrue:[self printerName] |
|
6161 |
ifFalse:[self remotePrinterName, ' on ', self remotePrinterHost] |
|
6162 |
||
6163 |
"Created: / 03-08-2006 / 12:50:09 / fm" |
|
6164 |
! ! |
|
6165 |
||
6166 |
!AbstractOperatingSystem::PrinterInfo methodsFor:'dc creation'! |
|
6167 |
||
6168 |
createDC |
|
6169 |
||
6170 |
^OperatingSystem createPrinterDC:self driverName |
|
6171 |
device:self printerName |
|
6172 |
output:self medium |
|
6173 |
initData:self documentProperties. |
|
6174 |
||
6175 |
"Created: / 02-08-2006 / 16:51:02 / fm" |
|
6176 |
! ! |
|
6177 |
||
6178 |
!AbstractOperatingSystem::PrinterInfo methodsFor:'dialogs'! |
|
6179 |
||
6180 |
openPropertiesDialog |
|
6181 |
"Returns true if the documentProperties have been accepted. Otherwise, returns false" |
|
6182 |
|h newDocumentProperties| |
|
6183 |
||
6184 |
h := OperatingSystem openPrinter: self printerName. |
|
6185 |
newDocumentProperties := OperatingSystem documentPropertiesDialogFor:nil |
|
6186 |
hPrinter:h |
|
6187 |
pDeviceName: self printerName |
|
6188 |
devModeInput:self documentProperties. |
|
6189 |
(newDocumentProperties allSatisfy:[:el | el = 0]) |
|
6190 |
ifTrue:[^false]. |
|
6191 |
self documentProperties: newDocumentProperties. |
|
6192 |
OperatingSystem closePrinter:h. |
|
6193 |
^true |
|
6194 |
||
6195 |
"Created: / 28-07-2006 / 11:44:01 / fm" |
|
6196 |
"Modified: / 01-08-2006 / 11:55:49 / fm" |
|
6197 |
! ! |
|
6198 |
||
6199 |
!AbstractOperatingSystem::PrinterInfo methodsFor:'modifying'! |
|
6200 |
||
6201 |
setLandscapeOrientation |
|
6202 |
"DMORIENT_LANDSCAPE = 2" |
|
6203 |
self documentProperties orientation: 2 |
|
6204 |
||
6205 |
"Created: / 28-07-2006 / 15:53:35 / fm" |
|
6206 |
! |
|
6207 |
||
6208 |
setNumberOfCopies: n |
|
6209 |
||
6210 |
self documentProperties copies: n |
|
6211 |
||
6212 |
"Created: / 28-07-2006 / 16:04:04 / fm" |
|
6213 |
! |
|
6214 |
||
6215 |
setPortraitOrientation |
|
6216 |
"DMORIENT_PORTRAIT = 1" |
|
6217 |
self documentProperties orientation: 1 |
|
6218 |
||
6219 |
"Created: / 28-07-2006 / 15:49:45 / fm" |
|
6220 |
! ! |
|
6221 |
||
6222 |
!AbstractOperatingSystem::PrinterInfo methodsFor:'printing & storing'! |
|
6223 |
||
6224 |
printOn:aStream |
|
6225 |
aStream nextPutAll:(self class name); nextPutAll:'('. |
|
6226 |
printerName printOn:aStream. |
|
6227 |
aStream nextPutAll:')'. |
|
6228 |
||
6229 |
"Created: / 27-07-2006 / 12:30:28 / fm" |
|
6230 |
! ! |
|
6231 |
||
6232 |
!AbstractOperatingSystem::PrinterInfo methodsFor:'private'! |
|
6233 |
||
6234 |
getDocumentProperties |
|
6235 |
"Returns a aDevModeStructure" |
|
6236 |
|h devMode | |
|
6237 |
||
6238 |
h := OperatingSystem openPrinter: self printerName. |
|
6239 |
devMode := OperatingSystem getDocumentProperties:nil |
|
6240 |
hPrinter:h |
|
6241 |
pDeviceName: self printerName. |
|
6242 |
OperatingSystem closePrinter: h. |
|
6243 |
^devMode |
|
6244 |
||
6245 |
"Created: / 28-07-2006 / 11:49:33 / fm" |
|
6246 |
"Modified: / 31-07-2006 / 10:33:04 / fm" |
|
6247 |
! |
|
6248 |
||
6249 |
getPrinterInfo2 |
|
6250 |
"Returns a aPrinterInfo2 structure" |
|
6251 |
||
6252 |
printerInfo2 := OperatingSystem getPrinterInfo2: self printerName. |
|
6253 |
^printerInfo2 |
|
6254 |
||
6255 |
"Created: / 01-08-2006 / 13:50:55 / fm" |
|
6256 |
"Modified: / 01-08-2006 / 15:11:03 / fm" |
|
6257 |
! |
|
6258 |
||
6259 |
printerInfo2 |
|
6260 |
"Returns a aPrinterInfo2 structure" |
|
6261 |
printerInfo2 isNil ifTrue:[self getPrinterInfo2.]. |
|
6262 |
^printerInfo2 |
|
6263 |
||
6264 |
"Created: / 01-08-2006 / 15:10:18 / fm" |
|
6265 |
! |
|
6266 |
||
6267 |
setDocumentProperties |
|
6268 |
"Sets a aDevModeStructure or nil if the printer is not available" |
|
6269 |
||
6270 |
self documentProperties: self getDocumentProperties |
|
6271 |
||
6272 |
"Created: / 31-07-2006 / 13:04:58 / fm" |
|
6273 |
! ! |
|
6274 |
||
6275 |
!AbstractOperatingSystem::PrinterInfo methodsFor:'queries'! |
|
6276 |
||
6277 |
isAvailable |
|
6278 |
||
6279 |
^self documentProperties notNil |
|
6280 |
||
6281 |
"Created: / 31-07-2006 / 13:08:58 / fm" |
|
6282 |
! ! |
|
6283 |
||
7514 | 6284 |
!AbstractOperatingSystem::TimeInfo methodsFor:'accessing'! |
6285 |
||
6286 |
at:index |
|
6287 |
"backward compatibility" |
|
6288 |
||
8357 | 6289 |
<resource: #obsolete> |
7514 | 6290 |
self obsoleteMethodWarning:'use accessor for index ', index printString. |
7739
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6291 |
|
7514 | 6292 |
index == 1 ifTrue:[ |
8669 | 6293 |
^ self year. |
7514 | 6294 |
]. |
6295 |
index == 2 ifTrue:[ |
|
8669 | 6296 |
^ self month. |
7514 | 6297 |
]. |
6298 |
index == 3 ifTrue:[ |
|
8669 | 6299 |
^ self day. |
7514 | 6300 |
]. |
6301 |
index == 4 ifTrue:[ |
|
8669 | 6302 |
^ self hours. |
7514 | 6303 |
]. |
6304 |
index == 5 ifTrue:[ |
|
8669 | 6305 |
^ self minutes. |
7514 | 6306 |
]. |
6307 |
index == 6 ifTrue:[ |
|
8669 | 6308 |
^ self seconds. |
7514 | 6309 |
]. |
6310 |
index == 7 ifTrue:[ |
|
8669 | 6311 |
^ self utcOffset. |
7514 | 6312 |
]. |
6313 |
index == 8 ifTrue:[ |
|
8669 | 6314 |
^ self dst. |
7514 | 6315 |
]. |
6316 |
index == 9 ifTrue:[ |
|
8669 | 6317 |
^ self milliseconds. |
7514 | 6318 |
]. |
6319 |
index == 10 ifTrue:[ |
|
8669 | 6320 |
^ self dayInYear. |
7514 | 6321 |
]. |
6322 |
index == 11 ifTrue:[ |
|
8669 | 6323 |
^ self dayInWeek. |
7514 | 6324 |
]. |
6325 |
self subscriptBoundsError:index |
|
6326 |
! |
|
6327 |
||
6328 |
day |
|
6329 |
^ day |
|
6330 |
! |
|
6331 |
||
6332 |
dayInWeek |
|
6333 |
^ dayInWeek |
|
6334 |
! |
|
6335 |
||
6336 |
dayInYear |
|
6337 |
^ dayInYear |
|
6338 |
! |
|
6339 |
||
6340 |
dst |
|
6341 |
^ dst |
|
6342 |
! |
|
6343 |
||
6344 |
hours |
|
6345 |
^ hours |
|
6346 |
! |
|
6347 |
||
6348 |
milliseconds |
|
6349 |
^ milliseconds |
|
6350 |
! |
|
6351 |
||
6352 |
milliseconds:something |
|
6353 |
milliseconds := something. |
|
6354 |
! |
|
6355 |
||
6356 |
minutes |
|
6357 |
^ minutes |
|
6358 |
! |
|
6359 |
||
6360 |
month |
|
6361 |
^ month |
|
6362 |
! |
|
6363 |
||
6364 |
seconds |
|
6365 |
^ seconds |
|
6366 |
! |
|
6367 |
||
6368 |
utcOffset |
|
8887 | 6369 |
"return the difference between UTC (Greenwich Mean Time) and the local time in seconds. |
6370 |
If daylight saving time applies to ourself, take that into account. |
|
6371 |
Add utcOffset to convert from local time to UTC time. |
|
6372 |
Subtract utcOffset to convert from UTC time to local time. |
|
6373 |
||
6374 |
If utcOffset is negative, the local timezone is east of Greenwich. |
|
6375 |
If utcOffset is positive, the local timezone is west of Greenwich." |
|
6376 |
||
7514 | 6377 |
^ utcOffset |
6378 |
! |
|
6379 |
||
6380 |
year |
|
6381 |
^ year |
|
6382 |
! |
|
6383 |
||
8669 | 6384 |
year:yearArg month:monthArg day:dayArg hours:hoursArg minutes:minutesArg seconds:secondsArg milliseconds:millisecondsArg utcOffset:utcOffsetArg dst:dstArg dayInYear:dayInYearArg dayInWeek:dayInWeekArg |
7739
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6385 |
"set instance variables (automatically generated)" |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6386 |
|
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6387 |
year := yearArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6388 |
month := monthArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6389 |
day := dayArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6390 |
hours := hoursArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6391 |
minutes := minutesArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6392 |
seconds := secondsArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6393 |
milliseconds := millisecondsArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6394 |
utcOffset := utcOffsetArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6395 |
dst := dstArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6396 |
dayInYear := dayInYearArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6397 |
dayInWeek := dayInWeekArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6398 |
! |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6399 |
|
8669 | 6400 |
year:yearArg month:monthArg day:dayArg hours:hoursArg minutes:minutesArg seconds:secondsArg utcOffset:utcOffsetArg dst:dstArg dayInYear:dayInYearArg dayInWeek:dayInWeekArg |
7514 | 6401 |
"set instance variables (automatically generated)" |
6402 |
||
6403 |
year := yearArg. |
|
6404 |
month := monthArg. |
|
6405 |
day := dayArg. |
|
6406 |
hours := hoursArg. |
|
6407 |
minutes := minutesArg. |
|
6408 |
seconds := secondsArg. |
|
6409 |
utcOffset := utcOffsetArg. |
|
6410 |
dst := dstArg. |
|
6411 |
dayInYear := dayInYearArg. |
|
6412 |
dayInWeek := dayInWeekArg. |
|
6413 |
! ! |
|
6414 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6415 |
!AbstractOperatingSystem class methodsFor:'documentation'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6416 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6417 |
version |
9700 | 6418 |
^ '$Header: /cvs/stx/stx/libbasic/AbstractOperatingSystem.st,v 1.156 2006-08-24 10:43:40 cg Exp $' |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6419 |
! ! |
6772 | 6420 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6421 |
AbstractOperatingSystem initialize! |