author | Merge Script |
Sat, 25 Jul 2015 06:39:11 +0200 | |
branch | jv |
changeset 18640 | 358b275dced9 |
parent 18366 | a6e62e167c32 |
parent 18639 | 3529a684d3fb |
child 18744 | 0f193129cde0 |
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 |
13891 | 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 |
" |
5407 | 12 |
"{ Package: 'stx:libbasic' }" |
13 |
||
17362
c07512e3643c
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17178
diff
changeset
|
14 |
"{ NameSpace: Smalltalk }" |
c07512e3643c
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17178
diff
changeset
|
15 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
16 |
Object subclass:#AbstractOperatingSystem |
13155 | 17 |
instanceVariableNames:'' |
18 |
classVariableNames:'ConcreteClass LastErrorNumber LocaleInfo OSSignals PipeFailed |
|
18356
1312e3a2100b
lazy fetch of error signals
Claus Gittinger <cg@exept.de>
parents:
18303
diff
changeset
|
19 |
ErrorSignal Resources' |
13155 | 20 |
poolDictionaries:'' |
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 |
13155 | 25 |
instanceVariableNames:'printerName attributes documentProperties printerInfo2' |
26 |
classVariableNames:'' |
|
27 |
poolDictionaries:'' |
|
28 |
privateIn:AbstractOperatingSystem |
|
9476 | 29 |
! |
30 |
||
7514 | 31 |
Object subclass:#TimeInfo |
13155 | 32 |
instanceVariableNames:'year month day hours minutes seconds utcOffset dst milliseconds |
33 |
dayInYear dayInWeek' |
|
34 |
classVariableNames:'' |
|
35 |
poolDictionaries:'' |
|
36 |
privateIn:AbstractOperatingSystem |
|
7514 | 37 |
! |
38 |
||
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
39 |
Object subclass:#TimeZoneInfo |
13155 | 40 |
instanceVariableNames:'bias name standardYear standardMonth standardDay standardWeekDay |
41 |
standardHour standardMinute standardBias daylightName |
|
42 |
standardDate daylightDate daylightYear daylightMonth daylightDay |
|
43 |
daylightWeekDay daylightHour daylightMinute daylightBias' |
|
44 |
classVariableNames:'' |
|
45 |
poolDictionaries:'' |
|
46 |
privateIn:AbstractOperatingSystem |
|
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
47 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
48 |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
49 |
!AbstractOperatingSystem primitiveDefinitions! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
50 |
%{ |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
51 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
52 |
#include "stxOSDefs.h" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
53 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
54 |
%} |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
55 |
! ! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
56 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
57 |
!AbstractOperatingSystem class methodsFor:'documentation'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
58 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
59 |
copyright |
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 |
COPYRIGHT (c) 1988 by Claus Gittinger |
13891 | 62 |
All Rights Reserved |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
63 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
64 |
This software is furnished under a license and may be used |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
65 |
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
|
66 |
inclusion of the above copyright notice. This software may not |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
67 |
be provided or otherwise made available to, or used by, any |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
68 |
other person. No title to or ownership of the software is |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
69 |
hereby transferred. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
70 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
71 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
72 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
73 |
documentation |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
74 |
" |
4200 | 75 |
this class realizes services common to the supported operating systems; |
76 |
typically, services which can be implemented based upon more primitive |
|
77 |
functions, or which can be implemented in a portable way (but probably |
|
78 |
less performant) are implemented here. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
79 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
80 |
[Class variables:] |
13891 | 81 |
ConcreteClass <Class> the real OS class |
82 |
||
83 |
LocaleInfo <Dictionary> if non nil, that is taken instead of the operating |
|
84 |
systems locale definitions (allows for overwriting |
|
85 |
these, or provide a compatible info on systems which do |
|
86 |
not support locales) |
|
87 |
||
88 |
LastErrorNumber <Integer> the last value of errno |
|
89 |
||
90 |
OSSignals <Array> Array of signals to be raised for corresponding |
|
91 |
OperatingSystem signals. |
|
92 |
||
93 |
PipeFailed <Boolean> set if a fork (or popen) has failed; |
|
94 |
ST/X will avoid doing more forks/popens |
|
95 |
if this flag is set, for a slightly |
|
96 |
smoother operation. |
|
97 |
||
98 |
ErrorSignal <Signal> Parentsignal of all OS error signals. |
|
99 |
not directly raised. |
|
100 |
||
18356
1312e3a2100b
lazy fetch of error signals
Claus Gittinger <cg@exept.de>
parents:
18303
diff
changeset
|
101 |
misc concrete error reporting signals |
1312e3a2100b
lazy fetch of error signals
Claus Gittinger <cg@exept.de>
parents:
18303
diff
changeset
|
102 |
|
1312e3a2100b
lazy fetch of error signals
Claus Gittinger <cg@exept.de>
parents:
18303
diff
changeset
|
103 |
|
1312e3a2100b
lazy fetch of error signals
Claus Gittinger <cg@exept.de>
parents:
18303
diff
changeset
|
104 |
|
3576
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 |
[author:] |
13891 | 107 |
Claus Gittinger |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
108 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
109 |
[see also:] |
13891 | 110 |
OSProcessStatus |
111 |
Filename Date Time |
|
112 |
ExternalStream FileStream PipeStream Socket |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
113 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
114 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
115 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
116 |
examples |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
117 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
118 |
various queries |
13891 | 119 |
[exBegin] |
8669 | 120 |
Transcript |
13891 | 121 |
showCR:'hello ' , (OperatingSystem getLoginName) |
122 |
[exEnd] |
|
123 |
||
124 |
[exBegin] |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
125 |
OperatingSystem isUNIXlike ifTrue:[ |
13891 | 126 |
Transcript showCR:'this is some UNIX-like OS' |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
127 |
] ifFalse:[ |
13891 | 128 |
Transcript showCR:'this OS is not UNIX-like' |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
129 |
] |
13891 | 130 |
[exEnd] |
131 |
||
132 |
[exBegin] |
|
8669 | 133 |
Transcript |
13891 | 134 |
showCR:'this machine is called ' , OperatingSystem getHostName |
135 |
[exEnd] |
|
136 |
||
137 |
[exBegin] |
|
8669 | 138 |
Transcript |
13891 | 139 |
showCR:('this machine is in the ' |
140 |
, OperatingSystem getDomainName |
|
141 |
, ' domain') |
|
142 |
[exEnd] |
|
143 |
||
144 |
[exBegin] |
|
8669 | 145 |
Transcript |
13891 | 146 |
showCR:('this machine''s CPU is a ' |
147 |
, OperatingSystem getCPUType |
|
148 |
) |
|
149 |
[exEnd] |
|
150 |
||
151 |
[exBegin] |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
152 |
Transcript showCR:'executing ls command ...'. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
153 |
OperatingSystem executeCommand:'ls'. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
154 |
Transcript showCR:'... done.'. |
13891 | 155 |
[exEnd] |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
156 |
|
8669 | 157 |
locking a file |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
158 |
(should be executed on two running smalltalks - not in two threads): |
13891 | 159 |
[exBegin] |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
160 |
|f| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
161 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
162 |
f := 'testFile' asFilename readWriteStream. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
163 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
164 |
10 timesRepeat:[ |
13891 | 165 |
'about to lock ...' printCR. |
166 |
[ |
|
167 |
OperatingSystem |
|
168 |
lockFD:(f fileDescriptor) |
|
169 |
shared:false |
|
170 |
blocking:false |
|
171 |
] whileFalse:[ |
|
172 |
'process ' print. OperatingSystem getProcessId print. ' is waiting' printCR. |
|
173 |
Delay waitForSeconds:1 |
|
174 |
]. |
|
175 |
'LOCKED ...' printCR. |
|
176 |
Delay waitForSeconds:10. |
|
177 |
'unlock ...' printCR. |
|
178 |
(OperatingSystem |
|
179 |
unlockFD:(f fileDescriptor)) printCR. |
|
180 |
Delay waitForSeconds:3. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
181 |
] |
13891 | 182 |
[exBegin] |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
183 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
184 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
185 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
186 |
!AbstractOperatingSystem class methodsFor:'initialization'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
187 |
|
14820
79d0f328ac64
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14806
diff
changeset
|
188 |
getConcreteClass |
79d0f328ac64
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14806
diff
changeset
|
189 |
|osType| |
79d0f328ac64
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14806
diff
changeset
|
190 |
|
79d0f328ac64
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14806
diff
changeset
|
191 |
osType := self getSystemType. |
79d0f328ac64
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14806
diff
changeset
|
192 |
osType = 'win32' ifTrue:[ |
14846
ebbd3993788d
oops - duplicate case: AF_NS is the same as AF_IPX on windows
Claus Gittinger <cg@exept.de>
parents:
14845
diff
changeset
|
193 |
^ Win32OperatingSystem |
14820
79d0f328ac64
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14806
diff
changeset
|
194 |
]. |
79d0f328ac64
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14806
diff
changeset
|
195 |
osType = 'osx' ifTrue:[ |
14846
ebbd3993788d
oops - duplicate case: AF_NS is the same as AF_IPX on windows
Claus Gittinger <cg@exept.de>
parents:
14845
diff
changeset
|
196 |
^ OSXOperatingSystem |
14820
79d0f328ac64
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14806
diff
changeset
|
197 |
]. |
79d0f328ac64
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14806
diff
changeset
|
198 |
osType = 'os2' ifTrue:[ |
14846
ebbd3993788d
oops - duplicate case: AF_NS is the same as AF_IPX on windows
Claus Gittinger <cg@exept.de>
parents:
14845
diff
changeset
|
199 |
^ OS2OperatingSystem |
14820
79d0f328ac64
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14806
diff
changeset
|
200 |
]. |
79d0f328ac64
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14806
diff
changeset
|
201 |
osType = 'macos' ifTrue:[ |
14846
ebbd3993788d
oops - duplicate case: AF_NS is the same as AF_IPX on windows
Claus Gittinger <cg@exept.de>
parents:
14845
diff
changeset
|
202 |
^ MacOperatingSystem |
14820
79d0f328ac64
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14806
diff
changeset
|
203 |
]. |
79d0f328ac64
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14806
diff
changeset
|
204 |
((osType = 'VMS') or:[osType = 'openVMS']) ifTrue:[ |
14846
ebbd3993788d
oops - duplicate case: AF_NS is the same as AF_IPX on windows
Claus Gittinger <cg@exept.de>
parents:
14845
diff
changeset
|
205 |
^ OpenVMSOperatingSystem |
14820
79d0f328ac64
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14806
diff
changeset
|
206 |
]. |
79d0f328ac64
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14806
diff
changeset
|
207 |
^ UnixOperatingSystem |
79d0f328ac64
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14806
diff
changeset
|
208 |
! |
79d0f328ac64
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14806
diff
changeset
|
209 |
|
6278 | 210 |
initResources |
8715 | 211 |
"/ allow for ResourcePack class to be missing (non-GUI smalltalks) |
10734
47c85e53a9d0
handle & ignore error when loading resources;
Claus Gittinger <cg@exept.de>
parents:
10733
diff
changeset
|
212 |
|
8715 | 213 |
ResourcePack notNil ifTrue:[ |
13891 | 214 |
Error handle:[:ex | |
215 |
'OS [warning]: error when reading resources for libbasic:' errorPrintCR. |
|
216 |
'OS [info]: 'errorPrint. ex description errorPrintCR. |
|
217 |
'OS [info]: backtrace: ' errorPrintCR. |
|
218 |
self withErrorStreamDo:[:s | |
|
219 |
ex suspendedContext fullPrintAllOn:s. |
|
220 |
]. |
|
221 |
] do:[ |
|
222 |
Resources := ResourcePack forPackage:(self package). |
|
223 |
]. |
|
8715 | 224 |
] |
10734
47c85e53a9d0
handle & ignore error when loading resources;
Claus Gittinger <cg@exept.de>
parents:
10733
diff
changeset
|
225 |
|
13351 | 226 |
"Modified: / 21-04-2011 / 12:48:02 / cg" |
6278 | 227 |
! |
228 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
229 |
initialize |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
230 |
"initialize the class" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
231 |
|
17531
29483ad00461
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17518
diff
changeset
|
232 |
"/ protect against double initialization |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
233 |
ErrorSignal isNil ifTrue:[ |
17637 | 234 |
self initializeConcreteClass. |
235 |
||
236 |
OSErrorHolder initialize. |
|
237 |
ErrorSignal := OsError. |
|
238 |
Smalltalk addDependent:self. "/ to catch language changes |
|
6278 | 239 |
]. |
3576
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 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
242 |
initializeConcreteClass |
14820
79d0f328ac64
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14806
diff
changeset
|
243 |
OperatingSystem := ConcreteClass := self getConcreteClass. |
3576
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 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
246 |
!AbstractOperatingSystem class methodsFor:'OS signal constants'! |
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 |
sigABRT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
249 |
"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
|
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 |
sigALRM |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
256 |
"return the signal number for SIGALRM - 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 |
sigBREAK |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
263 |
"return the signal number for SIGBREAK - 0 if not supported. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
264 |
This is an MSDOS specific signal" |
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 |
sigBUS |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
270 |
"return the signal number for SIGBUS - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
271 |
(the numeric value is not the same across unix-systems)" |
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 |
sigCHLD |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
277 |
"return the signal number for SIGCHLD - 0 if not supported |
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 |
sigCONT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
284 |
"return the signal number for SIGCONT - 0 if not supported |
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 |
sigDANGER |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
291 |
"return the signal number for SIGDANGER - 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 |
sigEMT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
298 |
"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
|
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 |
sigFP |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
305 |
"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
|
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 |
sigGRANT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
312 |
"return the signal number for SIGGRANT - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
313 |
(seems to be an AIX special)" |
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 |
sigHUP |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
319 |
"return the signal number for SIGHUP |
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 |
sigILL |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
326 |
"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
|
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 |
sigINT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
333 |
"return the signal number for SIGINT |
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 |
sigIO |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
340 |
"return the signal number for SIGIO - 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 |
sigIOT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
347 |
"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
|
348 |
(the numeric value is not the same across unix-systems)" |
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 |
sigKILL |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
354 |
"return the signal number for SIGKILL |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
355 |
(the numeric value is not the same across unix-systems)" |
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 |
sigLOST |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
361 |
"return the signal number for SIGLOST - 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 |
sigMIGRATE |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
368 |
"return the signal number for SIGMIGRATE - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
369 |
(seems to be an AIX special)" |
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 |
sigMSG |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
375 |
"return the signal number for SIGMSG - 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 |
sigPIPE |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
382 |
"return the signal number for SIGPIPE - 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 |
sigPOLL |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
389 |
"return the signal number for SIGPOLL - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
390 |
(the numeric value is not the same across unix-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 |
sigPRE |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
396 |
"return the signal number for SIGPRE - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
397 |
(seems to be an AIX special)" |
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 |
sigPROF |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
403 |
"return the signal number for SIGPROF - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
404 |
(the numeric value is not the same across unix-systems)" |
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 |
sigPWR |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
410 |
"return the signal number for SIGPWR - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
411 |
(not available on all systems)" |
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 |
sigQUIT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
417 |
"return the signal number for SIGQUIT |
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 |
sigRETRACT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
424 |
"return the signal number for SIGRETRACT - 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 |
sigSAK |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
431 |
"return the signal number for SIGSAK - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
432 |
(seems to be an AIX special)" |
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 |
sigSEGV |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
438 |
"return the signal number for SIGSEGV - 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 |
sigSOUND |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
445 |
"return the signal number for SIGSOUND - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
446 |
(seems to be an AIX special)" |
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 |
sigSTOP |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
452 |
"return the signal number for SIGSTOP - 0 if not supported |
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 |
sigSYS |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
459 |
"return the signal number for SIGSYS - 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 |
sigTERM |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
466 |
"return the signal number for SIGTERM - 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 |
sigTRAP |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
473 |
"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
|
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 |
sigTSTP |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
480 |
"return the signal number for SIGTSTP - 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 |
sigTTIN |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
487 |
"return the signal number for SIGTTIN - 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 |
sigTTOU |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
494 |
"return the signal number for SIGTTOU - 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 |
sigURG |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
501 |
"return the signal number for SIGURG - 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 |
sigUSR1 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
508 |
"return the signal number for SIGUSR1 - 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 |
sigUSR2 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
515 |
"return the signal number for SIGUSR2 - 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 |
sigVTALRM |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
522 |
"return the signal number for SIGVTALRM - 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 |
sigWINCH |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
529 |
"return the signal number for SIGWINCH - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
530 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
531 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
532 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
533 |
! |
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 |
sigXCPU |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
536 |
"return the signal number for SIGXCPU - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
537 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
538 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
539 |
^ 0 |
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 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
542 |
sigXFSZ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
543 |
"return the signal number for SIGXFSZ - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
544 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
545 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
546 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
547 |
! ! |
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 |
!AbstractOperatingSystem class methodsFor:'Signal constants'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
550 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
551 |
accessDeniedErrorSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
552 |
"return the signal raised when a (file-) access is denied." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
553 |
|
18356
1312e3a2100b
lazy fetch of error signals
Claus Gittinger <cg@exept.de>
parents:
18303
diff
changeset
|
554 |
^ OSErrorHolder noPermissionsSignal |
3576
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 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
557 |
errorSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
558 |
"return the parent signal of all OS signals." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
559 |
|
8497 | 560 |
^ OsError |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
561 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
562 |
"Modified: 22.4.1996 / 13:11:31 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
563 |
! |
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 |
fileNotFoundErrorSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
566 |
"return the signal raised when a file was not found." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
567 |
|
18356
1312e3a2100b
lazy fetch of error signals
Claus Gittinger <cg@exept.de>
parents:
18303
diff
changeset
|
568 |
^ OSErrorHolder nonexistentSignal |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
569 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
570 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
571 |
invalidArgumentsSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
572 |
"return the signal which is raised for invalid arguments. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
573 |
Currently, this is never raised." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
574 |
|
18356
1312e3a2100b
lazy fetch of error signals
Claus Gittinger <cg@exept.de>
parents:
18303
diff
changeset
|
575 |
^ OsInvalidArgumentsError |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
576 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
577 |
"Created: 13.9.1997 / 10:46:47 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
578 |
"Modified: 13.9.1997 / 10:47:03 / cg" |
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 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
581 |
unsupportedOperationSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
582 |
"return the signal which is raised when an operation |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
583 |
is attempted, which is not supported by the OS. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
584 |
(For example, creating a link on VMS or MSDOS)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
585 |
|
18356
1312e3a2100b
lazy fetch of error signals
Claus Gittinger <cg@exept.de>
parents:
18303
diff
changeset
|
586 |
^ OSErrorHolder unsupportedOperationSignal. |
3576
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 |
|
6278 | 589 |
!AbstractOperatingSystem class methodsFor:'change & update'! |
590 |
||
591 |
update:something with:aParameter from:changedObject |
|
7497
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7492
diff
changeset
|
592 |
"Smalltalk notifies us about changes" |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7492
diff
changeset
|
593 |
|
6278 | 594 |
((something == #Language) or:[something == #LanguageTerritory]) ifTrue:[ |
13891 | 595 |
self initResources |
6278 | 596 |
] |
597 |
! ! |
|
598 |
||
13107
1bfbec80d8e3
added: #openApplicationForDocument:operation:
Claus Gittinger <cg@exept.de>
parents:
12971
diff
changeset
|
599 |
!AbstractOperatingSystem class methodsFor:'dummy shell operations'! |
1bfbec80d8e3
added: #openApplicationForDocument:operation:
Claus Gittinger <cg@exept.de>
parents:
12971
diff
changeset
|
600 |
|
1bfbec80d8e3
added: #openApplicationForDocument:operation:
Claus Gittinger <cg@exept.de>
parents:
12971
diff
changeset
|
601 |
openApplicationForDocument:aFilenameOrString operation:operationSymbol |
16575
08c339406134
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16574
diff
changeset
|
602 |
"open a windows-shell/mac finder/desktop application to present the document contained in aFilenameOrString. |
16574
d54c9b2690ce
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16573
diff
changeset
|
603 |
This is typically used to present help-files, html documents, pdf documents etc. |
13107
1bfbec80d8e3
added: #openApplicationForDocument:operation:
Claus Gittinger <cg@exept.de>
parents:
12971
diff
changeset
|
604 |
operationSymbol is one of: |
16948 | 605 |
open |
606 |
edit |
|
607 |
explore |
|
608 |
" |
|
609 |
||
610 |
self |
|
611 |
openApplicationForDocument:aFilenameOrString |
|
612 |
operation:operationSymbol |
|
613 |
mimeType:nil |
|
16573
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
614 |
! |
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
615 |
|
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
616 |
openApplicationForDocument:aFilenameOrString operation:operationSymbol mimeType:mimeTypeStringArgOrNil |
16575
08c339406134
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16574
diff
changeset
|
617 |
"open a windows-shell/mac finder/desktop application to present the document contained in aFilenameOrString. |
16574
d54c9b2690ce
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16573
diff
changeset
|
618 |
This is typically used to present help-files, html documents, pdf documents etc. |
15471
321b9e2f9924
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15249
diff
changeset
|
619 |
operationSymbol is one of: |
16948 | 620 |
open |
621 |
edit |
|
622 |
explore |
|
16573
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
623 |
mimeTypeStringArgOrNil is e.g. 'text/html' or: 'application/pdf'. |
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
624 |
If nil is passed in, the file's suffix is used to guess the mime type. |
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
625 |
" |
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
626 |
|
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
627 |
self |
16948 | 628 |
openApplicationForDocument:aFilenameOrString |
629 |
operation:operationSymbol |
|
630 |
mimeType:mimeTypeStringArgOrNil |
|
631 |
ifNone:[ |
|
632 |
"/ last resort: use a fileBrowser |
|
633 |
UserPreferences fileBrowserClass openOn:aFilenameOrString |
|
634 |
]. |
|
16573
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
635 |
|
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
636 |
" |
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
637 |
self openApplicationForDocument: Filename currentDirectory operation:#open |
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
638 |
self openApplicationForDocument: '..\..\doc\books\ArtOfSmalltalk\artMissing186187Fix1.pdf' asFilename operation:#open |
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
639 |
|
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
640 |
self openApplicationForDocument: 'C:\WINDOWS\Help\clipbrd.chm' asFilename operation:#open |
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
641 |
" |
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
642 |
|
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
643 |
"Created: / 29-10-2010 / 12:16:38 / cg" |
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
644 |
"Modified: / 05-02-2011 / 16:13:42 / cg" |
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
645 |
! |
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
646 |
|
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
647 |
openApplicationForDocument:aFilenameOrString operation:operationSymbol mimeType:mimeTypeStringArgOrNil ifNone:exceptionBlock |
16575
08c339406134
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16574
diff
changeset
|
648 |
"open a windows-shell/mac finder/desktop application to present the document contained in aFilenameOrString. |
16574
d54c9b2690ce
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16573
diff
changeset
|
649 |
This is typically used to present help-files, html documents, pdf documents etc. |
16573
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
650 |
operationSymbol is one of: |
16948 | 651 |
open |
652 |
edit |
|
653 |
explore |
|
16573
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
654 |
mimeTypeStringArgOrNil is e.g. 'text/html' or: 'application/pdf'; |
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
655 |
if nil is passed in, the file's suffix is used to guess it. |
15471
321b9e2f9924
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15249
diff
changeset
|
656 |
" |
321b9e2f9924
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15249
diff
changeset
|
657 |
|
321b9e2f9924
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15249
diff
changeset
|
658 |
|openCommand mimeTypeString| |
321b9e2f9924
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15249
diff
changeset
|
659 |
|
16573
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
660 |
mimeTypeString := mimeTypeStringArgOrNil. |
15471
321b9e2f9924
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15249
diff
changeset
|
661 |
|
321b9e2f9924
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15249
diff
changeset
|
662 |
MIMETypes notNil ifTrue:[ |
16948 | 663 |
mimeTypeString isNil ifTrue:[ |
664 |
mimeTypeString := MIMETypes mimeTypeForFilename:aFilenameOrString. |
|
665 |
]. |
|
666 |
mimeTypeString notNil ifTrue:[ |
|
667 |
openCommand := MIMETypes defaultCommandTemplateToOpenMimeType:mimeTypeString. |
|
668 |
]. |
|
15471
321b9e2f9924
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15249
diff
changeset
|
669 |
]. |
321b9e2f9924
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15249
diff
changeset
|
670 |
openCommand notEmptyOrNil ifTrue:[ |
16948 | 671 |
(openCommand includesSubString:'%1') ifTrue:[ |
672 |
openCommand := openCommand bindWith:aFilenameOrString asString. |
|
673 |
] ifFalse:[ |
|
674 |
openCommand := openCommand, ' "', aFilenameOrString asString, '"'. |
|
675 |
]. |
|
676 |
||
677 |
(self |
|
678 |
startProcess:openCommand |
|
679 |
inputFrom:nil outputTo:nil |
|
680 |
errorTo:nil auxFrom:nil |
|
681 |
environment:nil inDirectory:nil) notNil |
|
682 |
ifTrue:[ |
|
683 |
^ self. |
|
684 |
]. |
|
15471
321b9e2f9924
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15249
diff
changeset
|
685 |
]. |
16573
a77c7cf596c2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16499
diff
changeset
|
686 |
exceptionBlock notNil ifTrue:[ exceptionBlock value ]. |
13107
1bfbec80d8e3
added: #openApplicationForDocument:operation:
Claus Gittinger <cg@exept.de>
parents:
12971
diff
changeset
|
687 |
|
1bfbec80d8e3
added: #openApplicationForDocument:operation:
Claus Gittinger <cg@exept.de>
parents:
12971
diff
changeset
|
688 |
" |
1bfbec80d8e3
added: #openApplicationForDocument:operation:
Claus Gittinger <cg@exept.de>
parents:
12971
diff
changeset
|
689 |
self openApplicationForDocument: Filename currentDirectory operation:#open |
1bfbec80d8e3
added: #openApplicationForDocument:operation:
Claus Gittinger <cg@exept.de>
parents:
12971
diff
changeset
|
690 |
self openApplicationForDocument: '..\..\doc\books\ArtOfSmalltalk\artMissing186187Fix1.pdf' asFilename operation:#open |
1bfbec80d8e3
added: #openApplicationForDocument:operation:
Claus Gittinger <cg@exept.de>
parents:
12971
diff
changeset
|
691 |
|
1bfbec80d8e3
added: #openApplicationForDocument:operation:
Claus Gittinger <cg@exept.de>
parents:
12971
diff
changeset
|
692 |
self openApplicationForDocument: 'C:\WINDOWS\Help\clipbrd.chm' asFilename operation:#open |
1bfbec80d8e3
added: #openApplicationForDocument:operation:
Claus Gittinger <cg@exept.de>
parents:
12971
diff
changeset
|
693 |
" |
1bfbec80d8e3
added: #openApplicationForDocument:operation:
Claus Gittinger <cg@exept.de>
parents:
12971
diff
changeset
|
694 |
|
1bfbec80d8e3
added: #openApplicationForDocument:operation:
Claus Gittinger <cg@exept.de>
parents:
12971
diff
changeset
|
695 |
"Created: / 29-10-2010 / 12:16:38 / cg" |
13283 | 696 |
"Modified: / 05-02-2011 / 16:13:42 / cg" |
13107
1bfbec80d8e3
added: #openApplicationForDocument:operation:
Claus Gittinger <cg@exept.de>
parents:
12971
diff
changeset
|
697 |
! ! |
1bfbec80d8e3
added: #openApplicationForDocument:operation:
Claus Gittinger <cg@exept.de>
parents:
12971
diff
changeset
|
698 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
699 |
!AbstractOperatingSystem class methodsFor:'error messages'! |
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 |
clearLastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
702 |
"return the last errors number. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
703 |
See also: #lastErrorSymbol and #lastErrorString. |
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 |
13891 | 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 := nil. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
708 |
|
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 |
AbstractOperatingSystem clearLastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
711 |
" |
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 |
"Created: 12.4.1996 / 09:28:58 / stefan" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
714 |
"Modified: 12.4.1996 / 09:38:51 / stefan" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
715 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
716 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
717 |
currentErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
718 |
"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
|
719 |
Notice, that the value of this flag is only valid immediately |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
720 |
after the error occurred - it gets updated with every other |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
721 |
request to the OS. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
722 |
Use lastErrorNumber - currentErrorNumber is invalidated by |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
723 |
many, many internal calls." |
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 |
^ self lastErrorNumber |
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 |
OperatingSystem currentErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
729 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
730 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
731 |
|
6284 | 732 |
errorHolderForNumber:anInteger |
733 |
||
734 |
^ self subclassResponsibility |
|
735 |
! |
|
736 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
737 |
errorNumberFor:aSymbol |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
738 |
"given a symbolic error, return the numeric; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
739 |
(i.e. errorNumberFor:#EBADF returns EBADF's value). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
740 |
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
|
741 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
742 |
^ -1 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
743 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
744 |
|
6278 | 745 |
errorStringForSymbol:errorSymbol |
746 |
"return an errorMessage for an errorSymbol |
|
747 |
(as kept in an osErrorHolder)." |
|
748 |
||
749 |
Resources isNil ifTrue:[ |
|
14657 | 750 |
"/ do not care to load resource strings, if the error happens during early initialization |
751 |
Smalltalk isInitialized ifFalse:[ |
|
752 |
^ errorSymbol |
|
753 |
]. |
|
754 |
"/ avoid endless recursion |
|
755 |
Error handle:[:ex | |
|
756 |
] do:[ |
|
757 |
self initResources. |
|
758 |
]. |
|
759 |
Resources isNil ifTrue:[ |
|
760 |
^ errorSymbol |
|
761 |
] |
|
6278 | 762 |
]. |
763 |
^ Resources at:errorSymbol ifAbsent:errorSymbol |
|
764 |
||
765 |
" |
|
8669 | 766 |
OperatingSystem errorStringForSymbol:#EPERM |
6278 | 767 |
OperatingSystem errorStringForSymbol:(OperatingSystem errorSymbolForNumber:4) |
768 |
" |
|
10733
c83c02dae4f8
handle & ignore error when loading resources;
Claus Gittinger <cg@exept.de>
parents:
10684
diff
changeset
|
769 |
|
13352
fe1136703358
changed: #errorStringForSymbol:
Claus Gittinger <cg@exept.de>
parents:
13351
diff
changeset
|
770 |
"Modified: / 21-04-2011 / 13:13:29 / cg" |
6278 | 771 |
! |
772 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
773 |
errorSymbolAndTextForNumber:errNr |
6284 | 774 |
"do not use - temporary for backward compatibility. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
775 |
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
|
776 |
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
|
777 |
|
6284 | 778 |
|holder errSym| |
779 |
||
780 |
holder := self errorHolderForNumber:errNr. |
|
781 |
errSym := holder errorSymbol. |
|
8669 | 782 |
^ Array |
13891 | 783 |
with:errSym |
784 |
with:(self errorStringForSymbol:errSym) |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
785 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
786 |
" |
8669 | 787 |
OperatingSystem errorSymbolAndTextForNumber:(OperatingSystem errorNumberFor:#EPERM) |
788 |
OperatingSystem errorSymbolAndTextForNumber:(OperatingSystem errorNumberFor:#EIO) |
|
6287 | 789 |
OperatingSystem errorSymbolAndTextForNumber:(OperatingSystem errorNumberFor:#ENXIO) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
790 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
791 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
792 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
793 |
errorSymbolForNumber:errNr |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
794 |
"return a symbol for a unix errorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
795 |
(as returned by a system call)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
796 |
|
6284 | 797 |
^ (self errorHolderForNumber:errNr) errorSymbol |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
798 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
799 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
800 |
OperatingSystem errorSymbolForNumber:4 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
801 |
OperatingSystem errorSymbolForNumber:2 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
802 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
803 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
804 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
805 |
errorTextForNumber:errNr |
8669 | 806 |
"return a message string from a unix errorNumber |
807 |
(as returned by a system call). |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
808 |
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
|
809 |
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
|
810 |
|
6284 | 811 |
^ (self errorHolderForNumber:errNr) errorString |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
812 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
813 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
814 |
OperatingSystem errorTextForNumber:4 |
8669 | 815 |
OperatingSystem errorTextForNumber:(OperatingSystem errorNumberFor:#EPERM) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
816 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
817 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
818 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
819 |
lastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
820 |
"return the last errors number. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
821 |
See also: #lastErrorSymbol and #lastErrorString. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
822 |
Notice: having a single error number is a bad idea in a multithreaded |
13891 | 823 |
environment - this interface will change." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
824 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
825 |
^ LastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
826 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
827 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
828 |
OperatingSystem lastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
829 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
830 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
831 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
832 |
lastErrorString |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
833 |
"return a message string describing the last error. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
834 |
See also: #lastErrorNumber and #lastErrorSymbol. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
835 |
Notice: having a single error number is a bad idea in a multithreaded |
13891 | 836 |
environment - this interface will change." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
837 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
838 |
LastErrorNumber isNil ifTrue:[^ nil]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
839 |
^ self errorTextForNumber:LastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
840 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
841 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
842 |
OperatingSystem lastErrorString |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
843 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
844 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
845 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
846 |
lastErrorSymbol |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
847 |
"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
|
848 |
See also: #lastErrorNumber and #lastErrorString. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
849 |
Notice: having a single error number is a bad idea in a multithreaded |
13891 | 850 |
environment - this interface will change." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
851 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
852 |
LastErrorNumber isNil ifTrue:[^ nil]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
853 |
^ self errorSymbolForNumber:LastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
854 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
855 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
856 |
OperatingSystem lastErrorSymbol |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
857 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
858 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
859 |
|
7656 | 860 |
!AbstractOperatingSystem class methodsFor:'executing OS commands-implementation'! |
861 |
||
862 |
exec:aCommandPath withArguments:argArray environment:env fileDescriptors:fds fork:doFork newPgrp:newGrp inDirectory:aDirectory |
|
863 |
"execute an OS command" |
|
864 |
||
865 |
^ self subclassResponsibility |
|
866 |
||
867 |
"Created: / 12.11.1998 / 14:46:15 / cg" |
|
868 |
! |
|
869 |
||
870 |
fork |
|
871 |
"fork a new (HEAVY-weight) unix process. |
|
872 |
Not supported with MSDOS & VMS systems. |
|
873 |
Dont confuse this with Block>>fork, which creates |
|
874 |
lightweight smalltalk processes. This method will return |
|
875 |
0 to the child process, and a non-zero number (which is the childs |
|
876 |
unix-process-id) to the parent (original) process. |
|
877 |
||
878 |
In normal situations, you dont need to use this low level entry; see |
|
879 |
#startProcess: and #executCommand: for higher level interfaces." |
|
880 |
||
881 |
"/ |
|
882 |
"/ not supported by OS |
|
883 |
"/ |
|
884 |
||
18356
1312e3a2100b
lazy fetch of error signals
Claus Gittinger <cg@exept.de>
parents:
18303
diff
changeset
|
885 |
^ self unsupportedOperationSignal raise |
7656 | 886 |
! |
7637 | 887 |
|
8669 | 888 |
startProcess:aCommandString inputFrom:anExternalInStream outputTo:anExternalOutStream |
7637 | 889 |
errorTo:anExternalErrStream auxFrom:anExternalAuxStreamOrNil environment:environment inDirectory:dir |
890 |
"start executing the OS command as specified by the argument, aCommandString |
|
891 |
as a separate process; do not wait for the command to finish. |
|
892 |
The commandString is passed to a shell for execution - see the description of |
|
893 |
'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
|
894 |
The command gets stdIn, stdOut and stdErr assigned from the arguments; |
|
895 |
each may be nil. |
|
896 |
Return the processId if successful, nil otherwise. |
|
897 |
Use #monitorPid:action: for synchronization and exec status return, |
|
898 |
or #killProcess: to stop it." |
|
899 |
||
900 |
"raise an error: must be redefined in concrete subclass(es)" |
|
901 |
||
902 |
^ self subclassResponsibility |
|
7656 | 903 |
! ! |
904 |
||
905 |
!AbstractOperatingSystem class methodsFor:'executing OS commands-private'! |
|
906 |
||
907 |
shuffleAllFrom:anInStream to:anOutStream lineWise:lineWise lockWith:aLock |
|
908 |
||
909 |
lineWise ifFalse:[ |
|
13891 | 910 |
^ anInStream copyToEndInto:anOutStream. |
7656 | 911 |
]. |
912 |
[anInStream atEnd] whileFalse:[ |
|
13891 | 913 |
aLock critical:[ |
914 |
self |
|
915 |
shuffleFrom:anInStream |
|
916 |
to:anOutStream |
|
917 |
lineWise:lineWise |
|
918 |
] |
|
7656 | 919 |
] |
920 |
! |
|
921 |
||
922 |
shuffleFrom:anInStream to:anOutStream lineWise:lineWise |
|
923 |
"copy data from anInStream to anOutStream. |
|
924 |
Caller makes sure, than anInStream does not block. |
|
925 |
anOutstream should have been set to non-blocking-mode" |
|
926 |
||
927 |
lineWise ifTrue:[ |
|
13891 | 928 |
|data| |
929 |
||
930 |
data := anInStream nextLine. |
|
931 |
data notNil ifTrue:[ |
|
932 |
anOutStream nextPutLine:data |
|
933 |
] . |
|
8669 | 934 |
] ifFalse:[ |
13891 | 935 |
anInStream copyToEndInto:anOutStream. |
7656 | 936 |
]. |
937 |
! |
|
938 |
||
8669 | 939 |
shuffleRestFrom:anInStream to:anOutStream lineWise:lineWise |
7656 | 940 |
[anInStream atEnd] whileFalse:[ |
13891 | 941 |
self |
942 |
shuffleFrom:anInStream |
|
943 |
to:anOutStream |
|
944 |
lineWise:lineWise. |
|
7656 | 945 |
]. |
946 |
! |
|
947 |
||
948 |
startProcess:aCommandString |
|
949 |
"start executing the OS command as specified by the argument, aCommandString |
|
950 |
as a separate process; do not wait for the command to finish. |
|
951 |
The commandString is passed to a shell for execution - see the description of |
|
952 |
'sh -c' in your UNIX manual. |
|
953 |
Return the processId if successful, nil otherwise. |
|
954 |
Use #waitForProcess: for synchronization and exec status return, |
|
955 |
or #killProcess: to stop it." |
|
956 |
||
957 |
^ self |
|
13891 | 958 |
startProcess:aCommandString |
959 |
inputFrom:nil |
|
960 |
outputTo:nil |
|
961 |
errorTo:nil |
|
962 |
auxFrom:nil |
|
963 |
inDirectory:nil |
|
7656 | 964 |
|
965 |
" |
|
966 |
|pid| |
|
967 |
||
968 |
pid := OperatingSystem startProcess:'sleep 2; echo 1; sleep 2; echo 2'. |
|
969 |
(Delay forSeconds:3) wait. |
|
970 |
OperatingSystem killProcess:pid. |
|
971 |
" |
|
972 |
" |
|
973 |
|pid| |
|
974 |
||
975 |
pid := OperatingSystem startProcess:'dir/l'. |
|
976 |
(Delay forSeconds:1) wait. |
|
977 |
OperatingSystem killProcess:pid. |
|
978 |
" |
|
979 |
" |
|
980 |
|pid| |
|
981 |
||
8669 | 982 |
pid := OperatingSystem |
13891 | 983 |
startProcess:'dir/l' |
984 |
inputFrom:nil |
|
985 |
outputTo:Stdout |
|
986 |
errorTo:nil |
|
987 |
inDirectory:nil. |
|
7656 | 988 |
(Delay forSeconds:2) wait. |
989 |
OperatingSystem killProcess:pid. |
|
990 |
" |
|
991 |
||
992 |
"Modified: / 21.3.1997 / 10:04:35 / dq" |
|
993 |
"Modified: / 10.11.1998 / 21:03:50 / cg" |
|
994 |
! |
|
995 |
||
996 |
startProcess:aCommandString inDirectory:aDirectory |
|
997 |
"start executing the OS command as specified by the argument, aCommandString |
|
998 |
as a separate process; do not wait for the command to finish. |
|
999 |
The commandString is passed to a shell for execution - see the description of |
|
1000 |
'sh -c' in your UNIX manual. |
|
1001 |
Return the processId if successful, nil otherwise. |
|
1002 |
Use #waitForProcess: for synchronization and exec status return, |
|
1003 |
or #killProcess: to stop it." |
|
1004 |
||
1005 |
^ self |
|
13891 | 1006 |
startProcess:aCommandString |
1007 |
inputFrom:nil |
|
1008 |
outputTo:nil |
|
1009 |
errorTo:nil |
|
1010 |
auxFrom:nil |
|
1011 |
inDirectory:aDirectory |
|
7656 | 1012 |
" |
1013 |
|pid| |
|
1014 |
||
1015 |
pid := OperatingSystem startProcess:'sleep 2; echo 1; sleep 2; echo 2'. |
|
1016 |
(Delay forSeconds:3) wait. |
|
1017 |
OperatingSystem killProcess:pid. |
|
1018 |
" |
|
1019 |
||
1020 |
"Modified: / 21.3.1997 / 10:04:35 / dq" |
|
1021 |
"Modified: / 28.1.1998 / 14:13:33 / md" |
|
1022 |
"Modified: / 10.11.1998 / 20:59:33 / cg" |
|
1023 |
! |
|
1024 |
||
1025 |
startProcess:aCommandString inputFrom:anExternalInStream outputTo:anExternalOutStream errorTo:anExternalErrStream |
|
1026 |
"start executing the OS command as specified by the argument, aCommandString |
|
1027 |
as a separate process; do not wait for the command to finish. |
|
1028 |
The commandString is passed to a shell for execution - see the description of |
|
1029 |
'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
|
1030 |
The command gets stdIn, stdOut and stdErr assigned from the arguments; |
|
1031 |
each may be nil. |
|
1032 |
Return the processId if successful, nil otherwise. |
|
1033 |
Use #monitorPid:action: for synchronization and exec status return, |
|
1034 |
or #killProcess: to stop it." |
|
1035 |
||
8669 | 1036 |
^ self |
13891 | 1037 |
startProcess:aCommandString |
1038 |
inputFrom:anExternalInStream |
|
1039 |
outputTo:anExternalOutStream |
|
1040 |
errorTo:anExternalErrStream |
|
1041 |
auxFrom:nil |
|
1042 |
inDirectory:nil |
|
7656 | 1043 |
|
1044 |
"Modified: / 10.11.1998 / 20:59:05 / cg" |
|
1045 |
! |
|
1046 |
||
8587 | 1047 |
startProcess:aCommandString inputFrom:anExternalInStream outputTo:anExternalOutStream |
1048 |
errorTo:anExternalErrStream auxFrom:anAuxiliaryStream inDirectory:dir |
|
1049 |
||
8669 | 1050 |
^ self |
13891 | 1051 |
startProcess:aCommandString |
1052 |
inputFrom:anExternalInStream |
|
1053 |
outputTo:anExternalOutStream |
|
1054 |
errorTo:anExternalErrStream |
|
1055 |
auxFrom:anAuxiliaryStream |
|
1056 |
environment:nil |
|
1057 |
inDirectory:dir |
|
8587 | 1058 |
! |
1059 |
||
7656 | 1060 |
startProcess:aCommandString inputFrom:anExternalInStream outputTo:anExternalOutStream errorTo:anExternalErrStream inDirectory:dir |
1061 |
"start executing the OS command as specified by the argument, aCommandString |
|
1062 |
as a separate process; do not wait for the command to finish. |
|
1063 |
The commandString is passed to a shell for execution - see the description of |
|
1064 |
'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
|
1065 |
The command gets stdIn, stdOut and stdErr assigned from the arguments; |
|
1066 |
each may be nil. |
|
1067 |
Return the processId if successful, nil otherwise. |
|
1068 |
Use #monitorPid:action: for synchronization and exec status return, |
|
1069 |
or #killProcess: to stop it." |
|
1070 |
||
1071 |
^ self |
|
13891 | 1072 |
startProcess:aCommandString |
1073 |
inputFrom:anExternalInStream |
|
1074 |
outputTo:anExternalOutStream |
|
1075 |
errorTo:anExternalErrStream |
|
1076 |
auxFrom:nil |
|
1077 |
inDirectory:dir |
|
7637 | 1078 |
! ! |
1079 |
||
8587 | 1080 |
!AbstractOperatingSystem class methodsFor:'executing OS commands-public'! |
7656 | 1081 |
|
1082 |
executeCommand:aCommandString |
|
1083 |
"execute the unix command specified by the argument, aCommandString. |
|
17518
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1084 |
If aCommandString is a String, the commandString is passed to a shell for execution |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1085 |
- see the description of 'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1086 |
If aCommandString is an Array, the first element is the command to be executed, |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1087 |
and the other elements are the arguments to the command. No shell is invoked in this case. |
17431
bab67ea3bf22
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17362
diff
changeset
|
1088 |
Blocks until the command has finished. |
7656 | 1089 |
Return true if successful, false otherwise." |
1090 |
||
1091 |
^ self |
|
17637 | 1092 |
executeCommand:aCommandString |
1093 |
inputFrom:nil |
|
1094 |
outputTo:nil |
|
1095 |
errorTo:nil |
|
1096 |
auxFrom:nil |
|
1097 |
environment:nil |
|
1098 |
inDirectory:nil |
|
1099 |
lineWise:false |
|
1100 |
onError:[:status| false] |
|
7656 | 1101 |
|
1102 |
"unix: |
|
1103 |
||
8669 | 1104 |
OperatingSystem executeCommand:'sleep 30'. |
1105 |
OperatingSystem executeCommand:'pwd'. |
|
1106 |
OperatingSystem executeCommand:'ls -l'. |
|
1107 |
OperatingSystem executeCommand:'invalidCommand'. |
|
1108 |
OperatingSystem executeCommand:'rm /tmp/foofoofoofoo'. |
|
7656 | 1109 |
" |
1110 |
||
1111 |
"msdos: |
|
1112 |
||
8669 | 1113 |
OperatingSystem executeCommand:'dir' |
7656 | 1114 |
OperatingSystem executeCommand:'dir /w' |
1115 |
" |
|
1116 |
||
1117 |
"vms: |
|
1118 |
||
1119 |
OperatingSystem executeCommand:'dir' |
|
1120 |
OperatingSystem executeCommand:'purge' |
|
1121 |
OperatingSystem executeCommand:'cc foo.c' |
|
1122 |
" |
|
1123 |
||
1124 |
"Modified: / 7.1.1997 / 19:29:55 / stefan" |
|
1125 |
"Modified: / 10.11.1998 / 20:55:37 / cg" |
|
1126 |
! |
|
1127 |
||
1128 |
executeCommand:aCommandString errorTo:errorStream |
|
1129 |
"execute the unix command specified by the argument, aCommandString. |
|
17518
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1130 |
If aCommandString is a String, the commandString is passed to a shell for execution |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1131 |
- see the description of 'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1132 |
If aCommandString is an Array, the first element is the command to be executed, |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1133 |
and the other elements are the arguments to the command. No shell is invoked in this case. |
7656 | 1134 |
Return true if successful, false otherwise." |
1135 |
||
1136 |
^ self |
|
17637 | 1137 |
executeCommand:aCommandString |
1138 |
inputFrom:nil |
|
1139 |
outputTo:nil |
|
1140 |
errorTo:errorStream |
|
1141 |
auxFrom:nil |
|
1142 |
environment:nil |
|
1143 |
inDirectory:nil |
|
1144 |
lineWise:false |
|
1145 |
onError:[:status| false] |
|
7656 | 1146 |
|
1147 |
"unix: |
|
1148 |
||
8669 | 1149 |
OperatingSystem executeCommand:'ls -l' errorTo:Transcript. |
1150 |
OperatingSystem executeCommand:'invalidCommand' errorTo:Transcript. |
|
1151 |
OperatingSystem executeCommand:'rm /tmp/foofoofoofoo' errorTo:Transcript. |
|
7656 | 1152 |
" |
1153 |
! |
|
1154 |
||
10021 | 1155 |
executeCommand:aCommandString errorTo:errorStream inDirectory:aDirectory |
1156 |
"execute the unix command specified by the argument, aCommandString. |
|
17518
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1157 |
If aCommandString is a String, the commandString is passed to a shell for execution |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1158 |
- see the description of 'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1159 |
If aCommandString is an Array, the first element is the command to be executed, |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1160 |
and the other elements are the arguments to the command. No shell is invoked in this case. |
10021 | 1161 |
Return true if successful, false otherwise." |
1162 |
||
1163 |
^ self |
|
17637 | 1164 |
executeCommand:aCommandString |
1165 |
inputFrom:nil |
|
1166 |
outputTo:nil |
|
1167 |
errorTo:errorStream |
|
1168 |
auxFrom:nil |
|
1169 |
environment:nil |
|
1170 |
inDirectory:aDirectory |
|
1171 |
lineWise:false |
|
1172 |
onError:[:status| false] |
|
10021 | 1173 |
|
1174 |
"unix: |
|
1175 |
||
1176 |
OperatingSystem executeCommand:'ls -l' errorTo:Transcript. |
|
1177 |
OperatingSystem executeCommand:'invalidCommand' errorTo:Transcript. |
|
1178 |
OperatingSystem executeCommand:'rm /tmp/foofoofoofoo' errorTo:Transcript. |
|
1179 |
" |
|
1180 |
||
1181 |
"Created: / 29-09-2006 / 14:58:30 / cg" |
|
1182 |
! |
|
1183 |
||
7656 | 1184 |
executeCommand:aCommandString inDirectory:aDirectory |
1185 |
"execute the unix command specified by the argument, aCommandString. |
|
17518
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1186 |
If aCommandString is a String, the commandString is passed to a shell for execution |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1187 |
- see the description of 'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1188 |
If aCommandString is an Array, the first element is the command to be executed, |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1189 |
and the other elements are the arguments to the command. No shell is invoked in this case. |
7656 | 1190 |
Return true if successful, false otherwise." |
1191 |
||
1192 |
^ self |
|
17637 | 1193 |
executeCommand:aCommandString |
1194 |
inputFrom:nil |
|
1195 |
outputTo:nil |
|
1196 |
errorTo:nil |
|
1197 |
auxFrom:nil |
|
1198 |
environment:nil |
|
1199 |
inDirectory:aDirectory |
|
1200 |
lineWise:false |
|
1201 |
onError:[:exitStatus| false] |
|
7656 | 1202 |
|
1203 |
"Modified: / 10.11.1998 / 20:54:37 / cg" |
|
1204 |
! |
|
1205 |
||
8669 | 1206 |
executeCommand:aCommandString inDirectory:aDirectory onError:aBlock |
7656 | 1207 |
"execute the unix command specified by the argument, aCommandString. |
17518
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1208 |
If aCommandString is a String, the commandString is passed to a shell for execution |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1209 |
- see the description of 'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1210 |
If aCommandString is an Array, the first element is the command to be executed, |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1211 |
and the other elements are the arguments to the command. No shell is invoked in this case. |
7656 | 1212 |
Return true if successful, the value from aBlock if not. |
1213 |
If not successfull, aBlock is called with an OsProcessStatus |
|
1214 |
(containing the exit status) as argument." |
|
1215 |
||
1216 |
^ self |
|
17637 | 1217 |
executeCommand:aCommandString |
1218 |
inputFrom:nil |
|
1219 |
outputTo:nil |
|
1220 |
errorTo:nil |
|
1221 |
auxFrom:nil |
|
1222 |
environment:nil |
|
1223 |
inDirectory:aDirectory |
|
1224 |
lineWise:false |
|
1225 |
onError:aBlock |
|
7656 | 1226 |
|
1227 |
"Modified: / 10.11.1998 / 20:54:37 / cg" |
|
1228 |
! |
|
1229 |
||
17001
0524ca8f7a55
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16968
diff
changeset
|
1230 |
executeCommand:aCommandString inputFrom:anInStream outputTo:anOutStream errorTo:anErrStream |
0524ca8f7a55
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16968
diff
changeset
|
1231 |
"execute the unix command specified by the argument, aCommandString. |
17518
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1232 |
If aCommandString is a String, the commandString is passed to a shell for execution |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1233 |
- see the description of 'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1234 |
If aCommandString is an Array, the first element is the command to be executed, |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1235 |
and the other elements are the arguments to the command. No shell is invoked in this case. |
17001
0524ca8f7a55
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16968
diff
changeset
|
1236 |
Return true if successful, false if not." |
0524ca8f7a55
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16968
diff
changeset
|
1237 |
|
0524ca8f7a55
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16968
diff
changeset
|
1238 |
^ self |
17637 | 1239 |
executeCommand:aCommandString |
1240 |
inputFrom:anInStream |
|
1241 |
outputTo:anOutStream |
|
1242 |
errorTo:anErrStream |
|
1243 |
auxFrom:nil |
|
1244 |
environment:nil |
|
1245 |
inDirectory:nil |
|
1246 |
lineWise:false |
|
1247 |
onError:[:status | false] |
|
1248 |
||
1249 |
" |
|
1250 |
OperatingSystem |
|
1251 |
executeCommand:'ls' |
|
1252 |
inputFrom:nil |
|
1253 |
outputTo:Transcript |
|
1254 |
errorTo:Transcript |
|
1255 |
||
1256 |
|s| |
|
1257 |
s := WriteStream on:''. |
|
1258 |
(OperatingSystem |
|
1259 |
executeCommand:'ls' |
|
1260 |
inputFrom:nil |
|
1261 |
outputTo:s |
|
1262 |
errorTo:Transcript) ifTrue:[Transcript showCR:s contents] |
|
1263 |
||
1264 |
OperatingSystem |
|
1265 |
executeCommand:'dir' |
|
1266 |
inputFrom:nil |
|
1267 |
outputTo:Transcript |
|
1268 |
errorTo:Transcript |
|
1269 |
||
1270 |
OperatingSystem |
|
1271 |
executeCommand:'foo' |
|
1272 |
inputFrom:Transcript |
|
1273 |
outputTo:Transcript |
|
1274 |
errorTo:nil |
|
1275 |
" |
|
1276 |
" |
|
1277 |
|outStr errStr| |
|
1278 |
||
1279 |
outStr := '' writeStream. |
|
1280 |
errStr := '' writeStream. |
|
1281 |
OperatingSystem |
|
1282 |
executeCommand:'ls' |
|
1283 |
inputFrom:nil |
|
1284 |
outputTo:outStr |
|
1285 |
errorTo:errStr |
|
1286 |
onError:[:status | Transcript flash]. |
|
1287 |
Transcript show:'out:'; showCR:outStr contents. |
|
1288 |
Transcript show:'err:'; showCR:errStr contents. |
|
1289 |
" |
|
1290 |
" |
|
1291 |
|outStr errStr| |
|
1292 |
||
1293 |
outStr := '' writeStream. |
|
1294 |
errStr := '' writeStream. |
|
1295 |
OperatingSystem |
|
1296 |
executeCommand:'ls /fooBar' |
|
1297 |
inputFrom:nil |
|
1298 |
outputTo:outStr |
|
1299 |
errorTo:errStr |
|
1300 |
onError:[:status | Transcript flash]. |
|
1301 |
Transcript show:'out:'; showCR:outStr contents. |
|
1302 |
Transcript show:'err:'; showCR:errStr contents. |
|
17001
0524ca8f7a55
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16968
diff
changeset
|
1303 |
" |
0524ca8f7a55
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16968
diff
changeset
|
1304 |
|
0524ca8f7a55
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16968
diff
changeset
|
1305 |
"Modified: / 10.11.1998 / 20:51:39 / cg" |
0524ca8f7a55
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16968
diff
changeset
|
1306 |
! |
0524ca8f7a55
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16968
diff
changeset
|
1307 |
|
17518
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1308 |
executeCommand:aCommandStringOrArray inputFrom:anInStream outputTo:anOutStream |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1309 |
errorTo:anErrStream auxFrom:anAuxStream environment:environmentDictionary |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1310 |
inDirectory:dirOrNil lineWise:lineWise onError:aBlock |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1311 |
|
17518
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1312 |
"execute the unix command specified by the argument, aCommandStringOrArray. |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1313 |
If aCommandString is a String, the commandString is passed to a shell for execution |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1314 |
- see the description of 'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1315 |
If aCommandString is an Array, the first element is the command to be executed, |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1316 |
and the other elements are the arguments to the command. No shell is invoked in this case. |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1317 |
Return true if successful, or the value of aBlock if not. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1318 |
If not successfull, aBlock is called with an OsProcessStatus |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1319 |
(containing the exit status) as argument. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1320 |
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
|
1321 |
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
|
1322 |
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
|
1323 |
those internal stream(s). |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1324 |
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
|
1325 |
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
|
1326 |
|
8669 | 1327 |
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
|
1328 |
and you don't want lines to be mangled. Set lineWise = false to |
17362
c07512e3643c
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17178
diff
changeset
|
1329 |
avoid blocking on pipes" |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1330 |
|
8669 | 1331 |
|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
|
1332 |
shuffledInStream shuffledOutStream shuffledErrStream shuffledAuxStream |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1333 |
inputShufflerProcess outputShufflerProcess errorShufflerProcess auxShufflerProcess stopShufflers |
17362
c07512e3643c
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17178
diff
changeset
|
1334 |
inStreamToClose outStreamToClose errStreamToClose auxStreamToClose nullStream terminateLock |
10387 | 1335 |
closeStreams| |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1336 |
|
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1337 |
terminateLock := Semaphore forMutualExclusion. |
8669 | 1338 |
((externalInStream := anInStream) notNil |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1339 |
and:[externalInStream isExternalStream not]) ifTrue:[ |
18639
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1340 |
pIn := NonPositionableExternalStream makePipe. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1341 |
inStreamToClose := externalInStream := pIn at:1. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1342 |
shuffledInStream := pIn at:2. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1343 |
anInStream isBinary ifTrue:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1344 |
shuffledInStream binary |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1345 |
]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1346 |
lineWise ifFalse:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1347 |
shuffledInStream blocking:false. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1348 |
]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1349 |
|
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1350 |
"/ start a reader process, shuffling data from the given |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1351 |
"/ inStream to the pipe (which is connected to the commands input) |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1352 |
inputShufflerProcess := |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1353 |
[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1354 |
[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1355 |
[anInStream atEnd] whileFalse:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1356 |
self shuffleFrom:anInStream to:shuffledInStream lineWise:lineWise. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1357 |
shuffledInStream flush |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1358 |
] |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1359 |
] ensure:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1360 |
shuffledInStream close |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1361 |
] |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1362 |
] newProcess |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1363 |
name:'cmd input shuffler'; |
10498
db5cd86b77e2
Be conservative when setting helper processes of executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
10491
diff
changeset
|
1364 |
"/ beSystemProcess; |
18639
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1365 |
resume. |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1366 |
]. |
8669 | 1367 |
((externalOutStream := anOutStream) notNil |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1368 |
and:[externalOutStream isExternalStream not]) ifTrue:[ |
18639
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1369 |
pOut := NonPositionableExternalStream makePipe. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1370 |
shuffledOutStream := (pOut at:1). |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1371 |
anOutStream isBinary ifTrue:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1372 |
shuffledOutStream binary |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1373 |
]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1374 |
outStreamToClose := externalOutStream := pOut at:2. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1375 |
outputShufflerProcess := |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1376 |
[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1377 |
WriteError handle:[:ex | |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1378 |
"/ ignored |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1379 |
] do:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1380 |
self shuffleAllFrom:shuffledOutStream to:anOutStream lineWise:lineWise lockWith:terminateLock. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1381 |
]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1382 |
] newProcess |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1383 |
priority:(Processor userSchedulingPriority "+ 1"); |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1384 |
name:'cmd output shuffler'; |
10498
db5cd86b77e2
Be conservative when setting helper processes of executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
10491
diff
changeset
|
1385 |
"/ beSystemProcess; |
18639
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1386 |
resume. |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1387 |
]. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1388 |
(externalErrStream := anErrStream) notNil ifTrue:[ |
18639
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1389 |
anErrStream == anOutStream ifTrue:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1390 |
externalErrStream := externalOutStream |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1391 |
] ifFalse:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1392 |
anErrStream isExternalStream ifFalse:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1393 |
pErr := NonPositionableExternalStream makePipe. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1394 |
shuffledErrStream := (pErr at:1). |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1395 |
anErrStream isBinary ifTrue:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1396 |
shuffledErrStream binary |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1397 |
]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1398 |
errStreamToClose := externalErrStream := pErr at:2. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1399 |
errorShufflerProcess := |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1400 |
[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1401 |
self shuffleAllFrom:shuffledErrStream to:anErrStream lineWise:lineWise lockWith:terminateLock. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1402 |
] newProcess |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1403 |
priority:(Processor userSchedulingPriority + 1); |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1404 |
name:'cmd err-output shuffler'; |
10498
db5cd86b77e2
Be conservative when setting helper processes of executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
10491
diff
changeset
|
1405 |
"/ beSystemProcess; |
18639
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1406 |
resume. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1407 |
] |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1408 |
] |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1409 |
]. |
8669 | 1410 |
((externalAuxStream := anAuxStream) notNil |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1411 |
and:[externalAuxStream isExternalStream not]) ifTrue:[ |
18639
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1412 |
pAux := NonPositionableExternalStream makePipe. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1413 |
auxStreamToClose := externalAuxStream := pAux at:1. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1414 |
shuffledAuxStream := pAux at:2. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1415 |
shuffledAuxStream blocking:false. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1416 |
anAuxStream isBinary ifTrue:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1417 |
shuffledAuxStream binary |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1418 |
]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1419 |
|
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1420 |
"/ start a reader process, shuffling data from the given |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1421 |
"/ auxStream to the pipe (which is connected to the commands aux) |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1422 |
auxShufflerProcess := |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1423 |
[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1424 |
[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1425 |
[anAuxStream atEnd] whileFalse:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1426 |
self shuffleFrom:anAuxStream to:shuffledAuxStream lineWise:false. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1427 |
shuffledAuxStream flush |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1428 |
] |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1429 |
] ensure:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1430 |
shuffledAuxStream close |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1431 |
] |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1432 |
] newProcess |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1433 |
name:'cmd aux shuffler'; |
10498
db5cd86b77e2
Be conservative when setting helper processes of executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
10491
diff
changeset
|
1434 |
"/ beSystemProcess; |
18639
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1435 |
resume. |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1436 |
]. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1437 |
|
14831
64f76e173521
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14820
diff
changeset
|
1438 |
stopShufflers := [:shuffleRest | |
18639
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1439 |
inputShufflerProcess notNil ifTrue:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1440 |
terminateLock critical:[inputShufflerProcess terminate]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1441 |
inputShufflerProcess waitUntilTerminated |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1442 |
]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1443 |
auxShufflerProcess notNil ifTrue:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1444 |
terminateLock critical:[auxShufflerProcess terminate]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1445 |
auxShufflerProcess waitUntilTerminated |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1446 |
]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1447 |
outputShufflerProcess notNil ifTrue:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1448 |
terminateLock critical:[outputShufflerProcess terminate]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1449 |
outputShufflerProcess waitUntilTerminated. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1450 |
shuffleRest ifTrue:[ self shuffleRestFrom:shuffledOutStream to:anOutStream lineWise:lineWise ]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1451 |
shuffledOutStream close. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1452 |
]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1453 |
errorShufflerProcess notNil ifTrue:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1454 |
terminateLock critical:[errorShufflerProcess terminate]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1455 |
errorShufflerProcess waitUntilTerminated. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1456 |
shuffleRest ifTrue:[ self shuffleRestFrom:shuffledErrStream to:anErrStream lineWise:lineWise ]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1457 |
shuffledErrStream close. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1458 |
]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1459 |
]. |
10387 | 1460 |
|
1461 |
closeStreams := [ |
|
18639
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1462 |
inStreamToClose notNil ifTrue:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1463 |
inStreamToClose close |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1464 |
]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1465 |
errStreamToClose notNil ifTrue:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1466 |
errStreamToClose close |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1467 |
]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1468 |
outStreamToClose notNil ifTrue:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1469 |
outStreamToClose close |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1470 |
]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1471 |
auxStreamToClose notNil ifTrue:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1472 |
auxStreamToClose close |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1473 |
]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1474 |
nullStream notNil ifTrue:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1475 |
nullStream close |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1476 |
]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1477 |
]. |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1478 |
|
10387 | 1479 |
|
1480 |
sema := Semaphore new name:'OS command wait'. |
|
1481 |
[ |
|
18639
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1482 |
externalInStream isNil ifTrue:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1483 |
externalInStream := nullStream := Filename nullDevice readWriteStream. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1484 |
]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1485 |
externalOutStream isNil ifTrue:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1486 |
nullStream isNil ifTrue:[nullStream := Filename nullDevice writeStream]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1487 |
externalOutStream := nullStream. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1488 |
]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1489 |
externalErrStream isNil ifTrue:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1490 |
externalErrStream := externalOutStream |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1491 |
]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1492 |
|
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1493 |
pid := Processor |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1494 |
monitor:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1495 |
self |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1496 |
startProcess:aCommandStringOrArray |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1497 |
inputFrom:externalInStream |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1498 |
outputTo:externalOutStream |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1499 |
errorTo:externalErrStream |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1500 |
auxFrom:externalAuxStream |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1501 |
environment:environmentDictionary |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1502 |
inDirectory:dirOrNil |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1503 |
] |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1504 |
action:[:status | |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1505 |
status stillAlive ifFalse:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1506 |
exitStatus := status. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1507 |
sema signal. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1508 |
self closePid:pid |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1509 |
] |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1510 |
]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1511 |
|
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1512 |
pid isNil ifTrue:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1513 |
exitStatus := self osProcessStatusClass processCreationFailure |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1514 |
] ifFalse:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1515 |
sema wait. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1516 |
]. |
10387 | 1517 |
] ifCurtailed:[ |
18639
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1518 |
closeStreams value. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1519 |
pid notNil ifTrue:[ |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1520 |
"/ terminate the os-command (and all of its forked commands) |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1521 |
self terminateProcessGroup:pid. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1522 |
self terminateProcess:pid. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1523 |
self closePid:pid. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1524 |
]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1525 |
stopShufflers value:false. |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1526 |
]. |
10387 | 1527 |
|
1528 |
closeStreams value. |
|
14831
64f76e173521
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14820
diff
changeset
|
1529 |
stopShufflers value:true. |
16335
8f156497ba5c
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16326
diff
changeset
|
1530 |
(exitStatus isNil or:[exitStatus success]) ifFalse:[ |
18639
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1531 |
^ aBlock value:exitStatus |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1532 |
]. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1533 |
^ true |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1534 |
|
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1535 |
" |
18639
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1536 |
|outStream errStream| |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1537 |
|
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1538 |
outStream := '' writeStream. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1539 |
|
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1540 |
OperatingSystem executeCommand:'ls -l' |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1541 |
inputFrom:'abc' readStream |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1542 |
outputTo:outStream |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1543 |
errorTo:nil |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1544 |
inDirectory:nil |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1545 |
lineWise:true |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1546 |
onError:[:exitStatus | ^ false]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1547 |
outStream contents |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1548 |
" |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1549 |
|
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1550 |
" |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1551 |
|outStream errStream| |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1552 |
|
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1553 |
outStream := #[] writeStream. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1554 |
|
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1555 |
OperatingSystem executeCommand:'cat' |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1556 |
inputFrom:(ByteArray new:5000000) readStream |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1557 |
outputTo:outStream |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1558 |
errorTo:nil |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1559 |
inDirectory:nil |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1560 |
lineWise:false |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1561 |
onError:[:exitStatus | ^ false]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1562 |
outStream size |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1563 |
" |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1564 |
|
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1565 |
" |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1566 |
|outStream errStream| |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1567 |
|
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1568 |
outStream := '' writeStream. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1569 |
|
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1570 |
OperatingSystem executeCommand:'gpg -s --batch --no-tty --passphrase-fd 0 /tmp/passwd' |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1571 |
inputFrom:'bla' readStream |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1572 |
outputTo:outStream |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1573 |
errorTo:nil |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1574 |
inDirectory:nil |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1575 |
lineWise:true |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1576 |
onError:[:exitStatus | false]. |
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
1577 |
outStream contents |
10387 | 1578 |
" |
1579 |
||
1580 |
"Modified: / 11-02-2007 / 20:54:39 / cg" |
|
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1581 |
! |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1582 |
|
8669 | 1583 |
executeCommand:aCommandString inputFrom:anInStream outputTo:anOutStream errorTo:anErrStream auxFrom:anAuxStream inDirectory:dirOrNil lineWise:lineWise onError:aBlock |
1584 |
^ self |
|
13891 | 1585 |
executeCommand:aCommandString |
1586 |
inputFrom:anInStream |
|
1587 |
outputTo:anOutStream |
|
1588 |
errorTo:anErrStream |
|
1589 |
auxFrom:anAuxStream |
|
1590 |
environment:nil |
|
1591 |
inDirectory:dirOrNil |
|
1592 |
lineWise:lineWise |
|
1593 |
onError:aBlock |
|
7110
808437ea66af
add: #executeCommand:inputFrom:outputTo:errorTo:auxFrom:inDirectory:lineWise:onError:
ca
parents:
7106
diff
changeset
|
1594 |
! |
808437ea66af
add: #executeCommand:inputFrom:outputTo:errorTo:auxFrom:inDirectory:lineWise:onError:
ca
parents:
7106
diff
changeset
|
1595 |
|
16395
6f0be1e7811f
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16380
diff
changeset
|
1596 |
executeCommand:aCommandString inputFrom:anInStream outputTo:anOutStream errorTo:anErrStream environment:env onError:aBlock |
6f0be1e7811f
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16380
diff
changeset
|
1597 |
"execute the unix command specified by the argument, aCommandString. |
17518
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1598 |
If aCommandString is a String, the commandString is passed to a shell for execution |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1599 |
- see the description of 'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1600 |
If aCommandString is an Array, the first element is the command to be executed, |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1601 |
and the other elements are the arguments to the command. No shell is invoked in this case. |
16395
6f0be1e7811f
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16380
diff
changeset
|
1602 |
Return true if successful, the value from aBlock if not. |
6f0be1e7811f
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16380
diff
changeset
|
1603 |
If not successfull, aBlock is called with an OsProcessStatus |
6f0be1e7811f
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16380
diff
changeset
|
1604 |
(containing the exit status) as argument." |
6f0be1e7811f
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16380
diff
changeset
|
1605 |
|
6f0be1e7811f
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16380
diff
changeset
|
1606 |
^ self |
17637 | 1607 |
executeCommand:aCommandString |
1608 |
inputFrom:anInStream |
|
1609 |
outputTo:anOutStream |
|
1610 |
errorTo:anErrStream |
|
1611 |
auxFrom:nil |
|
1612 |
environment:env |
|
1613 |
inDirectory:nil |
|
1614 |
lineWise:false |
|
1615 |
onError:aBlock |
|
1616 |
||
1617 |
" |
|
1618 |
OperatingSystem |
|
1619 |
executeCommand:'dir' |
|
1620 |
inputFrom:nil |
|
1621 |
outputTo:nil |
|
1622 |
errorTo:nil |
|
1623 |
onError:[:status | Transcript flash] |
|
1624 |
||
1625 |
OperatingSystem |
|
1626 |
executeCommand:'foo' |
|
1627 |
inputFrom:nil |
|
1628 |
outputTo:nil |
|
1629 |
errorTo:nil |
|
1630 |
onError:[:status | Transcript flash] |
|
1631 |
" |
|
1632 |
" |
|
1633 |
|outStr errStr| |
|
1634 |
||
1635 |
outStr := '' writeStream. |
|
1636 |
errStr := '' writeStream. |
|
1637 |
OperatingSystem |
|
1638 |
executeCommand:'ls' |
|
1639 |
inputFrom:nil |
|
1640 |
outputTo:outStr |
|
1641 |
errorTo:errStr |
|
1642 |
onError:[:status | Transcript flash]. |
|
1643 |
Transcript show:'out:'; showCR:outStr contents. |
|
1644 |
Transcript show:'err:'; showCR:errStr contents. |
|
1645 |
" |
|
1646 |
" |
|
1647 |
|outStr errStr| |
|
1648 |
||
1649 |
outStr := '' writeStream. |
|
1650 |
errStr := '' writeStream. |
|
1651 |
OperatingSystem |
|
1652 |
executeCommand:'ls /fooBar' |
|
1653 |
inputFrom:nil |
|
1654 |
outputTo:outStr |
|
1655 |
errorTo:errStr |
|
1656 |
onError:[:status | Transcript flash]. |
|
1657 |
Transcript show:'out:'; showCR:outStr contents. |
|
1658 |
Transcript show:'err:'; showCR:errStr contents. |
|
16395
6f0be1e7811f
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16380
diff
changeset
|
1659 |
" |
6f0be1e7811f
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16380
diff
changeset
|
1660 |
|
6f0be1e7811f
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16380
diff
changeset
|
1661 |
"Modified: / 10.11.1998 / 20:51:39 / cg" |
6f0be1e7811f
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16380
diff
changeset
|
1662 |
! |
6f0be1e7811f
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16380
diff
changeset
|
1663 |
|
8655 | 1664 |
executeCommand:aCommandString inputFrom:inputStreamOrNil outputTo:outStreamOrNil errorTo:errStreamOrNil inDirectory:aDirectory |
1665 |
"much like #executeCommand:, but changes the current directory |
|
1666 |
for the command. Since this is OS specific, use this instead of |
|
1667 |
hardwiring any 'cd ..' command strings into your applictions." |
|
1668 |
||
1669 |
^ self |
|
16499 | 1670 |
executeCommand:aCommandString |
1671 |
inputFrom:inputStreamOrNil |
|
1672 |
outputTo:outStreamOrNil |
|
1673 |
errorTo:errStreamOrNil |
|
1674 |
auxFrom:nil |
|
1675 |
environment:nil |
|
1676 |
inDirectory:aDirectory |
|
1677 |
lineWise:false |
|
1678 |
onError:[:status| false] |
|
8669 | 1679 |
|
1680 |
" |
|
1681 |
OperatingSystem executeCommand:'tdump date.obj' inDirectory:'c:\winstx\stx\libbasic\objbc'. |
|
1682 |
OperatingSystem executeCommand:'xxdir date.obj' inDirectory:'c:\winstx\stx\libbasic\objbc'. |
|
1683 |
OperatingSystem executeCommand:'dir' inDirectory:'c:\'. |
|
1684 |
OperatingSystem executeCommand:'dir' |
|
8655 | 1685 |
" |
1686 |
||
1687 |
"Modified: / 20.1.1998 / 17:03:03 / md" |
|
1688 |
"Modified: / 10.11.1998 / 20:28:10 / cg" |
|
1689 |
"Created: / 10.11.1998 / 21:05:45 / cg" |
|
1690 |
! |
|
1691 |
||
8669 | 1692 |
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
|
1693 |
"execute the unix command specified by the argument, aCommandString. |
17518
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1694 |
If aCommandString is a String, the commandString is passed to a shell for execution |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1695 |
- see the description of 'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1696 |
If aCommandString is an Array, the first element is the command to be executed, |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1697 |
and the other elements are the arguments to the command. No shell is invoked in this case. |
7119 | 1698 |
Return true if successful, the value from aBlock if not. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1699 |
If not successfull, aBlock is called with an OsProcessStatus |
4847 | 1700 |
(containing the exit status) as argument. |
1701 |
The given in, out and err streams may be arbitrary (Smalltalk-) streams; |
|
1702 |
if any is not an external stream (which is required by the command), |
|
1703 |
extra pipes and shuffler processes are created, which stuff the data into |
|
1704 |
those internal stream(s). |
|
7059 | 1705 |
Nil stream args will execute the command connected to ST/X's standard input, output or |
1706 |
error resp. - i.e. usually, i/o will be from/to the terminal" |
|
6610 | 1707 |
|
7119 | 1708 |
^ self |
17637 | 1709 |
executeCommand:aCommandString |
1710 |
inputFrom:anInStream |
|
1711 |
outputTo:anOutStream |
|
1712 |
errorTo:anErrStream |
|
1713 |
auxFrom:nil |
|
1714 |
environment:nil |
|
1715 |
inDirectory:dirOrNil |
|
1716 |
lineWise:lineWise |
|
1717 |
onError:aBlock |
|
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1718 |
! |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1719 |
|
6162 | 1720 |
executeCommand:aCommandString inputFrom:anInStream outputTo:anOutStream errorTo:anErrStream inDirectory:dirOrNil onError:aBlock |
1721 |
"execute the unix command specified by the argument, aCommandString. |
|
17518
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1722 |
If aCommandString is a String, the commandString is passed to a shell for execution |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1723 |
- see the description of 'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1724 |
If aCommandString is an Array, the first element is the command to be executed, |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1725 |
and the other elements are the arguments to the command. No shell is invoked in this case. |
7119 | 1726 |
Return true if successful, the value from aBlock if not. |
6162 | 1727 |
If not successfull, aBlock is called with an OsProcessStatus |
1728 |
(containing the exit status) as argument. |
|
1729 |
The given in, out and err streams may be arbitrary (Smalltalk-) streams; |
|
1730 |
if any is not an external stream (which is required by the command), |
|
1731 |
extra pipes and shuffler processes are created, which stuff the data into |
|
1732 |
those internal stream(s). |
|
1733 |
Nil stream args will execute the command connected to ST/X's input, output or |
|
8669 | 1734 |
error resp. - i.e. i/o will be from/to the xterminal" |
1735 |
||
1736 |
^ self |
|
17637 | 1737 |
executeCommand:aCommandString |
1738 |
inputFrom:anInStream |
|
1739 |
outputTo:anOutStream |
|
1740 |
errorTo:anErrStream |
|
1741 |
auxFrom:nil |
|
1742 |
environment:nil |
|
1743 |
inDirectory:dirOrNil |
|
1744 |
lineWise:false |
|
1745 |
onError:aBlock |
|
6162 | 1746 |
|
1747 |
" |
|
1748 |
OperatingSystem |
|
17637 | 1749 |
executeCommand:'dir' |
1750 |
inputFrom:nil |
|
1751 |
outputTo:nil |
|
1752 |
errorTo:nil |
|
1753 |
inDirectory:'c:' |
|
1754 |
onError:[:status | Transcript flash] |
|
6162 | 1755 |
|
1756 |
OperatingSystem |
|
17637 | 1757 |
executeCommand:'foo' |
1758 |
inputFrom:nil |
|
1759 |
outputTo:nil |
|
1760 |
errorTo:nil |
|
1761 |
inDirectory:'/etc' |
|
1762 |
onError:[:status | Transcript flash] |
|
6162 | 1763 |
|
1764 |
|s| |
|
1765 |
s := '' writeStream. |
|
1766 |
OperatingSystem |
|
17637 | 1767 |
executeCommand:'ls -l' |
1768 |
inputFrom:nil |
|
1769 |
outputTo:s |
|
1770 |
errorTo:nil |
|
1771 |
onError:[:status | Transcript flash]. |
|
6162 | 1772 |
Transcript showCR:s contents. |
1773 |
||
1774 |
|s| |
|
1775 |
s := '' writeStream. |
|
1776 |
OperatingSystem |
|
17637 | 1777 |
executeCommand:'sh foo' |
1778 |
inputFrom:nil |
|
1779 |
outputTo:s |
|
1780 |
errorTo:s |
|
1781 |
onError:[:status | Transcript flash]. |
|
6162 | 1782 |
Transcript showCR:s contents. |
1783 |
" |
|
1784 |
||
1785 |
"Modified: / 25.3.1997 / 11:02:02 / stefan" |
|
1786 |
"Modified: / 28.1.1998 / 14:46:36 / md" |
|
1787 |
"Modified: / 10.11.1998 / 20:48:08 / cg" |
|
1788 |
"Created: / 10.11.1998 / 20:51:11 / cg" |
|
1789 |
! |
|
1790 |
||
6610 | 1791 |
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
|
1792 |
"execute the unix command specified by the argument, aCommandString. |
17518
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1793 |
If aCommandString is a String, the commandString is passed to a shell for execution |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1794 |
- see the description of 'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1795 |
If aCommandString is an Array, the first element is the command to be executed, |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1796 |
and the other elements are the arguments to the command. No shell is invoked in this case. |
7119 | 1797 |
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
|
1798 |
If not successfull, aBlock is called with an OsProcessStatus |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1799 |
(containing the exit status) as argument." |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1800 |
|
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1801 |
^ self |
17637 | 1802 |
executeCommand:aCommandString |
1803 |
inputFrom:anInStream |
|
1804 |
outputTo:anOutStream |
|
1805 |
errorTo:anErrStream |
|
1806 |
auxFrom:nil |
|
1807 |
environment:nil |
|
1808 |
inDirectory:nil |
|
1809 |
lineWise:false |
|
1810 |
onError:aBlock |
|
1811 |
||
1812 |
" |
|
1813 |
OperatingSystem |
|
1814 |
executeCommand:'dir' |
|
1815 |
inputFrom:nil |
|
1816 |
outputTo:nil |
|
1817 |
errorTo:nil |
|
1818 |
onError:[:status | Transcript flash] |
|
1819 |
||
1820 |
OperatingSystem |
|
1821 |
executeCommand:'foo' |
|
1822 |
inputFrom:nil |
|
1823 |
outputTo:nil |
|
1824 |
errorTo:nil |
|
1825 |
onError:[:status | Transcript flash] |
|
1826 |
" |
|
1827 |
" |
|
1828 |
|outStr errStr| |
|
1829 |
||
1830 |
outStr := '' writeStream. |
|
1831 |
errStr := '' writeStream. |
|
1832 |
OperatingSystem |
|
1833 |
executeCommand:'ls' |
|
1834 |
inputFrom:nil |
|
1835 |
outputTo:outStr |
|
1836 |
errorTo:errStr |
|
1837 |
onError:[:status | Transcript flash]. |
|
1838 |
Transcript show:'out:'; showCR:outStr contents. |
|
1839 |
Transcript show:'err:'; showCR:errStr contents. |
|
1840 |
" |
|
1841 |
" |
|
1842 |
|outStr errStr| |
|
1843 |
||
1844 |
outStr := '' writeStream. |
|
1845 |
errStr := '' writeStream. |
|
1846 |
OperatingSystem |
|
1847 |
executeCommand:'ls /fooBar' |
|
1848 |
inputFrom:nil |
|
1849 |
outputTo:outStr |
|
1850 |
errorTo:errStr |
|
1851 |
onError:[:status | Transcript flash]. |
|
1852 |
Transcript show:'out:'; showCR:outStr contents. |
|
1853 |
Transcript show:'err:'; showCR:errStr contents. |
|
6610 | 1854 |
" |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1855 |
|
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1856 |
"Modified: / 10.11.1998 / 20:51:39 / cg" |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1857 |
! |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1858 |
|
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1859 |
executeCommand:aCommandString onError:aBlock |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1860 |
"execute the unix command specified by the argument, aCommandString. |
17518
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1861 |
If aCommandString is a String, the commandString is passed to a shell for execution |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1862 |
- see the description of 'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1863 |
If aCommandString is an Array, the first element is the command to be executed, |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1864 |
and the other elements are the arguments to the command. No shell is invoked in this case. |
7119 | 1865 |
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
|
1866 |
If not successfull, aBlock is called with an OsProcessStatus |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1867 |
(containing the exit status) as argument." |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1868 |
|
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1869 |
^ self |
17637 | 1870 |
executeCommand:aCommandString |
1871 |
inputFrom:nil |
|
1872 |
outputTo:nil |
|
1873 |
errorTo:nil |
|
1874 |
auxFrom:nil |
|
1875 |
environment:nil |
|
1876 |
inDirectory:nil |
|
1877 |
lineWise:false |
|
1878 |
onError:aBlock |
|
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1879 |
|
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1880 |
"unix: |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1881 |
|
8669 | 1882 |
OperatingSystem executeCommand:'sleep 30' onError:[]. |
1883 |
OperatingSystem executeCommand:'pwd' onError:[:status|status inspect]. |
|
1884 |
OperatingSystem executeCommand:'ls -l' onError:[]. |
|
1885 |
OperatingSystem executeCommand:'invalidCommand' onError:[:status| status inspect]. |
|
1886 |
OperatingSystem executeCommand:'rm /tmp/foofoofoofoo'onError:[:status | status inspect]. |
|
1887 |
||
1888 |
OperatingSystem executeCommand:'dir' onError:[]. |
|
1889 |
OperatingSystem executeCommand:'foo' onError:[]. |
|
1890 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1891 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1892 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1893 |
"Modified: / 25.3.1997 / 11:06:43 / stefan" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1894 |
"Modified: / 28.1.1998 / 14:46:56 / md" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1895 |
"Created: / 5.6.1998 / 19:02:09 / cg" |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1896 |
"Modified: / 10.11.1998 / 20:55:02 / cg" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1897 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1898 |
|
7119 | 1899 |
executeCommand:aCommandString outputTo:anOutStreamOrNil |
1900 |
"execute the unix command specified by the argument, aCommandString. |
|
17518
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1901 |
If aCommandString is a String, the commandString is passed to a shell for execution |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1902 |
- see the description of 'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1903 |
If aCommandString is an Array, the first element is the command to be executed, |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
1904 |
and the other elements are the arguments to the command. No shell is invoked in this case. |
7119 | 1905 |
Return true if successful, false otherwise." |
1906 |
||
1907 |
^ self |
|
17637 | 1908 |
executeCommand:aCommandString |
1909 |
inputFrom:nil |
|
1910 |
outputTo:anOutStreamOrNil |
|
1911 |
errorTo:nil |
|
1912 |
auxFrom:nil |
|
1913 |
environment:nil |
|
1914 |
inDirectory:nil |
|
1915 |
lineWise:false |
|
1916 |
onError:[:status| false] |
|
7119 | 1917 |
|
1918 |
" |
|
8669 | 1919 |
String streamContents:[:s|OperatingSystem |
17637 | 1920 |
executeCommand:'ls' |
1921 |
outputTo:s |
|
7119 | 1922 |
] |
1923 |
" |
|
1924 |
||
1925 |
" |
|
8669 | 1926 |
String streamContents:[:s|OperatingSystem |
17637 | 1927 |
executeCommand:'pwd' |
1928 |
outputTo:s |
|
8669 | 1929 |
] |
7119 | 1930 |
" |
1931 |
! |
|
1932 |
||
4849 | 1933 |
executeCommand:aCommandString outputTo:outStreamOrNil errorTo:errStreamOrNil inDirectory:aDirectory |
1934 |
"much like #executeCommand:, but changes the current directory |
|
1935 |
for the command. Since this is OS specific, use this instead of |
|
1936 |
hardwiring any 'cd ..' command strings into your applictions." |
|
1937 |
||
1938 |
^ self |
|
16499 | 1939 |
executeCommand:aCommandString |
1940 |
inputFrom:nil |
|
1941 |
outputTo:outStreamOrNil |
|
1942 |
errorTo:errStreamOrNil |
|
1943 |
auxFrom:nil |
|
1944 |
environment:nil |
|
1945 |
inDirectory:aDirectory |
|
1946 |
lineWise:false |
|
1947 |
onError:[:status| false] |
|
4849 | 1948 |
|
1949 |
" |
|
8669 | 1950 |
OperatingSystem executeCommand:'tdump date.obj' inDirectory:'c:\winstx\stx\libbasic\objbc'. |
1951 |
OperatingSystem executeCommand:'xxdir date.obj' inDirectory:'c:\winstx\stx\libbasic\objbc'. |
|
1952 |
OperatingSystem executeCommand:'dir' inDirectory:'c:\'. |
|
1953 |
OperatingSystem executeCommand:'dir' |
|
4849 | 1954 |
" |
1955 |
||
1956 |
"Modified: / 20.1.1998 / 17:03:03 / md" |
|
1957 |
"Modified: / 10.11.1998 / 20:28:10 / cg" |
|
1958 |
"Created: / 10.11.1998 / 21:05:45 / cg" |
|
1959 |
! |
|
1960 |
||
13970
2fd5fb363275
added: #executeCommand:outputTo:inDirectory:
Claus Gittinger <cg@exept.de>
parents:
13955
diff
changeset
|
1961 |
executeCommand:aCommandString outputTo:outStreamOrNil inDirectory:aDirectory |
2fd5fb363275
added: #executeCommand:outputTo:inDirectory:
Claus Gittinger <cg@exept.de>
parents:
13955
diff
changeset
|
1962 |
"much like #executeCommand:, but changes the current directory |
2fd5fb363275
added: #executeCommand:outputTo:inDirectory:
Claus Gittinger <cg@exept.de>
parents:
13955
diff
changeset
|
1963 |
for the command. Since this is OS specific, use this instead of |
2fd5fb363275
added: #executeCommand:outputTo:inDirectory:
Claus Gittinger <cg@exept.de>
parents:
13955
diff
changeset
|
1964 |
hardwiring any 'cd ..' command strings into your applictions." |
2fd5fb363275
added: #executeCommand:outputTo:inDirectory:
Claus Gittinger <cg@exept.de>
parents:
13955
diff
changeset
|
1965 |
|
2fd5fb363275
added: #executeCommand:outputTo:inDirectory:
Claus Gittinger <cg@exept.de>
parents:
13955
diff
changeset
|
1966 |
^ self |
16499 | 1967 |
executeCommand:aCommandString |
1968 |
inputFrom:nil |
|
1969 |
outputTo:outStreamOrNil |
|
1970 |
errorTo:nil |
|
1971 |
auxFrom:nil |
|
1972 |
environment:nil |
|
1973 |
inDirectory:aDirectory |
|
1974 |
lineWise:false |
|
1975 |
onError:[:status| false] |
|
13970
2fd5fb363275
added: #executeCommand:outputTo:inDirectory:
Claus Gittinger <cg@exept.de>
parents:
13955
diff
changeset
|
1976 |
|
2fd5fb363275
added: #executeCommand:outputTo:inDirectory:
Claus Gittinger <cg@exept.de>
parents:
13955
diff
changeset
|
1977 |
" |
2fd5fb363275
added: #executeCommand:outputTo:inDirectory:
Claus Gittinger <cg@exept.de>
parents:
13955
diff
changeset
|
1978 |
OperatingSystem executeCommand:'tdump date.obj' inDirectory:'c:\winstx\stx\libbasic\objbc'. |
2fd5fb363275
added: #executeCommand:outputTo:inDirectory:
Claus Gittinger <cg@exept.de>
parents:
13955
diff
changeset
|
1979 |
OperatingSystem executeCommand:'xxdir date.obj' inDirectory:'c:\winstx\stx\libbasic\objbc'. |
2fd5fb363275
added: #executeCommand:outputTo:inDirectory:
Claus Gittinger <cg@exept.de>
parents:
13955
diff
changeset
|
1980 |
OperatingSystem executeCommand:'dir' inDirectory:'c:\'. |
2fd5fb363275
added: #executeCommand:outputTo:inDirectory:
Claus Gittinger <cg@exept.de>
parents:
13955
diff
changeset
|
1981 |
OperatingSystem executeCommand:'dir' |
2fd5fb363275
added: #executeCommand:outputTo:inDirectory:
Claus Gittinger <cg@exept.de>
parents:
13955
diff
changeset
|
1982 |
" |
2fd5fb363275
added: #executeCommand:outputTo:inDirectory:
Claus Gittinger <cg@exept.de>
parents:
13955
diff
changeset
|
1983 |
|
2fd5fb363275
added: #executeCommand:outputTo:inDirectory:
Claus Gittinger <cg@exept.de>
parents:
13955
diff
changeset
|
1984 |
"Modified: / 20-01-1998 / 17:03:03 / md" |
2fd5fb363275
added: #executeCommand:outputTo:inDirectory:
Claus Gittinger <cg@exept.de>
parents:
13955
diff
changeset
|
1985 |
"Created: / 23-01-2012 / 14:07:50 / cg" |
2fd5fb363275
added: #executeCommand:outputTo:inDirectory:
Claus Gittinger <cg@exept.de>
parents:
13955
diff
changeset
|
1986 |
! |
2fd5fb363275
added: #executeCommand:outputTo:inDirectory:
Claus Gittinger <cg@exept.de>
parents:
13955
diff
changeset
|
1987 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1988 |
getCommandOutputFrom:aCommand |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1989 |
"execute a simple command (such as hostname) and |
5482 | 1990 |
return the commands first line of output as a string (forget stdErr). |
4204 | 1991 |
If the command generates multiple output lines, only the first line is returned. |
1992 |
If the commands does not generate any output, an empty string is returned; |
|
1993 |
if the command fails, nil is returned." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1994 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1995 |
|result| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1996 |
|
5482 | 1997 |
result := self getCommandOutputFrom:aCommand maxNumberOfLines:1 errorDisposition:#discard. |
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1998 |
result notNil ifTrue:[ |
13891 | 1999 |
^ result firstIfEmpty:[''] |
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2000 |
]. |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2001 |
^ result |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2002 |
|
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2003 |
" |
8669 | 2004 |
OperatingSystem getCommandOutputFrom:'hostname' |
2005 |
OperatingSystem getCommandOutputFrom:'pwd' |
|
2006 |
OperatingSystem getCommandOutputFrom:'sleep 1' |
|
2007 |
OperatingSystem getCommandOutputFrom:'foo' |
|
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2008 |
" |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2009 |
|
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2010 |
! |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2011 |
|
5482 | 2012 |
getCommandOutputFrom:aCommand maxNumberOfLines:numLinesOrNil errorDisposition:errorDisposition |
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2013 |
"execute a simple command (such as hostname) and |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2014 |
return the commands output as a collection of strings, |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2015 |
but only up to the given number of lines (if non-nil). |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2016 |
If the command generates more output, only the first nLines are returned |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2017 |
(but the command is allowed to finish execution). |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2018 |
If the commands does not generate any output, an empty string is returned; |
5482 | 2019 |
if the command fails, nil is returned. |
2020 |
errorDisposition controls where the stdErr output should go, |
|
2021 |
and may be one of #discard, #inline or #stderr (default). |
|
8669 | 2022 |
#discard causes stderr to be discarded (/dev/null), |
5482 | 2023 |
#inline causes it to be written to smalltalks own stdout and |
2024 |
#stderr causes it to be written to smalltalks own stderr. |
|
2025 |
Nil is treated like #stderr" |
|
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2026 |
|
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2027 |
|result| |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2028 |
|
4200 | 2029 |
PipeFailed ~~ true ifTrue:[ |
16499 | 2030 |
PipeStream openErrorSignal handle:[:ex | |
2031 |
PipeFailed := true. |
|
2032 |
'OperatingSystem [warning]: cannot fork/popen' errorPrintCR. |
|
2033 |
ex return. |
|
2034 |
] do:[ |
|
2035 |
|p line| |
|
2036 |
||
2037 |
p := PipeStream |
|
2038 |
readingFrom:aCommand |
|
2039 |
errorDisposition:errorDisposition |
|
2040 |
inDirectory:nil. |
|
2041 |
result := StringCollection new. |
|
2042 |
[p atEnd] whileFalse:[ |
|
2043 |
line := p nextLine. |
|
2044 |
(numLinesOrNil isNil |
|
2045 |
or:[result size < numLinesOrNil]) ifTrue:[ |
|
2046 |
result add:line |
|
2047 |
]. |
|
2048 |
]. |
|
2049 |
p close. |
|
2050 |
(p exitStatus notNil and:[p exitStatus success]) ifFalse:[ |
|
2051 |
result := result asNilIfEmpty |
|
2052 |
]. |
|
2053 |
]. |
|
3576
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 |
^ result |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2056 |
|
4204 | 2057 |
" |
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2058 |
OperatingSystem getCommandOutputFrom:'ls' maxNumberOfLines:1 |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2059 |
OperatingSystem getCommandOutputFrom:'ls' maxNumberOfLines:10 |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2060 |
OperatingSystem getCommandOutputFrom:'ls' maxNumberOfLines:nil |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2061 |
OperatingSystem getCommandOutputFrom:'foo' maxNumberOfLines:nil |
4204 | 2062 |
" |
2063 |
||
2064 |
"Modified: / 19.5.1999 / 14:25:02 / cg" |
|
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 |
|
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2067 |
getFullCommandOutputFrom:aCommand |
5482 | 2068 |
"execute a command and |
5483 | 2069 |
return the commands output as a collection of strings (ignoring stdErr). |
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2070 |
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
|
2071 |
if the command fails, nil is returned." |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2072 |
|
5483 | 2073 |
^ self getCommandOutputFrom:aCommand maxNumberOfLines:nil errorDisposition:#discard |
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2074 |
|
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2075 |
" |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2076 |
OperatingSystem getFullCommandOutputFrom:'mt status' |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2077 |
" |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
2078 |
|
8587 | 2079 |
! ! |
2080 |
||
2081 |
!AbstractOperatingSystem class methodsFor:'executing OS commands-queries'! |
|
2082 |
||
2083 |
canExecuteCommand:aCommandString |
|
2084 |
"return true, if the OS can execute aCommand. |
|
2085 |
For now, this only works with UNIX." |
|
2086 |
||
2087 |
|fn fullPath| |
|
2088 |
||
2089 |
fullPath := (self pathOfCommand:aCommandString). |
|
2090 |
fullPath isNil ifTrue:[^ false]. |
|
2091 |
fn := fullPath asFilename. |
|
2092 |
^ fn exists and:[fn isExecutableProgram]. |
|
2093 |
||
2094 |
" |
|
8669 | 2095 |
OperatingSystem canExecuteCommand:'fooBar' |
2096 |
OperatingSystem canExecuteCommand:'ls' |
|
13891 | 2097 |
OperatingSystem canExecuteCommand:'cvs' |
2098 |
OperatingSystem canExecuteCommand:'diff' |
|
2099 |
OperatingSystem canExecuteCommand:'cvs.exe' |
|
14657 | 2100 |
OperatingSystem canExecuteCommand:'hg' |
2101 |
OperatingSystem pathOfCommand:'hg' |
|
13955
76a93181b0d8
comment/format in: #canExecuteCommand:
Claus Gittinger <cg@exept.de>
parents:
13953
diff
changeset
|
2102 |
" |
76a93181b0d8
comment/format in: #canExecuteCommand:
Claus Gittinger <cg@exept.de>
parents:
13953
diff
changeset
|
2103 |
|
76a93181b0d8
comment/format in: #canExecuteCommand:
Claus Gittinger <cg@exept.de>
parents:
13953
diff
changeset
|
2104 |
"Created: / 04-11-1995 / 19:13:54 / cg" |
8587 | 2105 |
! |
2106 |
||
2107 |
commandAndArgsForOSCommand:aCommandString |
|
2108 |
"get a shell and shell arguments for command execution" |
|
2109 |
||
2110 |
self subclassResponsibility |
|
2111 |
! |
|
2112 |
||
2113 |
executableFileExtensions |
|
2114 |
"return a collection of extensions for executable program files. |
|
2115 |
Only req'd for msdos & vms like systems ..." |
|
2116 |
||
2117 |
^ #('') |
|
2118 |
||
2119 |
"Created: 2.5.1997 / 11:42:29 / cg" |
|
2120 |
! |
|
2121 |
||
2122 |
nameOfSTXExecutable |
|
2123 |
"return the name of the running ST/X executable program. |
|
2124 |
Usually, 'stx' is returned - |
|
2125 |
but may be different for standAlone apps (or winstx.exe)." |
|
2126 |
||
2127 |
%{ |
|
2128 |
extern char *__stxExecutableName__(); |
|
2129 |
||
2130 |
RETURN (__MKSTRING(__stxExecutableName__())); |
|
2131 |
%} |
|
2132 |
" |
|
2133 |
OperatingSystem nameOfSTXExecutable |
|
2134 |
" |
|
2135 |
! |
|
2136 |
||
2137 |
pathOfCommand:aCommand |
|
2138 |
"find where aCommand's executable file is; |
|
2139 |
return its full pathName if there is such a command, otherwise |
|
2140 |
return nil." |
|
2141 |
||
2142 |
^ self subclassResponsibility |
|
2143 |
! |
|
2144 |
||
2145 |
pathOfSTXExecutable |
|
2146 |
"return the full path of the running ST/X executable program. |
|
8669 | 2147 |
Usually, '.../stx' is returned - |
8587 | 2148 |
but may be different for standAlone apps (or winstx.exe)." |
2149 |
||
13953
29462c1249dc
changed: #pathOfSTXExecutable
Claus Gittinger <cg@exept.de>
parents:
13891
diff
changeset
|
2150 |
|path| |
29462c1249dc
changed: #pathOfSTXExecutable
Claus Gittinger <cg@exept.de>
parents:
13891
diff
changeset
|
2151 |
|
29462c1249dc
changed: #pathOfSTXExecutable
Claus Gittinger <cg@exept.de>
parents:
13891
diff
changeset
|
2152 |
path := self pathOfCommand:(self nameOfSTXExecutable). |
16168 | 2153 |
path isNil ifTrue:[ |
2154 |
'./stx' asFilename exists ifTrue:[ |
|
2155 |
path := './stx' |
|
16499 | 2156 |
]. |
16168 | 2157 |
]. |
2158 |
path isNil ifTrue:[ |
|
2159 |
'OperatingSystem [warning]: cannot figure out my executable''s path' infoPrintCR. |
|
2160 |
]. |
|
13953
29462c1249dc
changed: #pathOfSTXExecutable
Claus Gittinger <cg@exept.de>
parents:
13891
diff
changeset
|
2161 |
^ path |
8587 | 2162 |
|
2163 |
" |
|
16499 | 2164 |
OperatingSystem pathOfSTXExecutable |
8587 | 2165 |
" |
13953
29462c1249dc
changed: #pathOfSTXExecutable
Claus Gittinger <cg@exept.de>
parents:
13891
diff
changeset
|
2166 |
|
29462c1249dc
changed: #pathOfSTXExecutable
Claus Gittinger <cg@exept.de>
parents:
13891
diff
changeset
|
2167 |
"Modified: / 20-01-2012 / 12:52:46 / cg" |
8587 | 2168 |
! ! |
2169 |
||
2170 |
!AbstractOperatingSystem class methodsFor:'executing OS commands-wrappers'! |
|
2171 |
||
2172 |
exec:aCommandPath withArguments:argArray |
|
2173 |
"execute the OS command specified by the argument, aCommandPath, with |
|
2174 |
arguments in argArray (no arguments, if nil). |
|
2175 |
If successful, this method does NOT return and smalltalk is gone. |
|
8669 | 2176 |
If not successful, it does return. |
8587 | 2177 |
Can be used on UNIX with fork or on other systems to chain to another program." |
7656 | 2178 |
|
8669 | 2179 |
^ self |
13891 | 2180 |
exec:aCommandPath |
2181 |
withArguments:argArray |
|
2182 |
environment:nil |
|
2183 |
fileDescriptors:#(0 1 2) |
|
2184 |
fork:false |
|
2185 |
newPgrp:false |
|
2186 |
inDirectory:nil |
|
8587 | 2187 |
|
2188 |
"/ never reached ... |
|
2189 |
||
2190 |
"Modified: / 12.11.1998 / 14:44:26 / cg" |
|
2191 |
! |
|
2192 |
||
2193 |
exec:aCommandPath withArguments:argArray fileDescriptors:fileDescriptors fork:doFork newPgrp:newPgrp inDirectory:aDirectory |
|
8669 | 2194 |
^ self |
13891 | 2195 |
exec:aCommandPath |
2196 |
withArguments:argArray |
|
2197 |
environment:nil |
|
2198 |
fileDescriptors:fileDescriptors |
|
2199 |
fork:doFork |
|
2200 |
newPgrp:newPgrp |
|
2201 |
inDirectory:aDirectory |
|
8587 | 2202 |
! |
2203 |
||
2204 |
exec:aCommandPath withArguments:argArray fork:doFork |
|
2205 |
"execute an OS command without I/O redirection. |
|
2206 |
The command reads its input and writes its output |
|
2207 |
from/to whatever terminal device ST/X was started |
|
2208 |
(typically, the terminal window)" |
|
2209 |
||
8669 | 2210 |
^ self |
13891 | 2211 |
exec:aCommandPath |
2212 |
withArguments:argArray |
|
2213 |
environment:nil |
|
2214 |
fileDescriptors:#(0 1 2) |
|
2215 |
fork:doFork |
|
2216 |
newPgrp:false |
|
2217 |
inDirectory:nil |
|
8587 | 2218 |
|
2219 |
" |
|
2220 |
|id| |
|
2221 |
||
2222 |
id := OperatingSystem fork. |
|
2223 |
id == 0 ifTrue:[ |
|
13891 | 2224 |
'I am the child'. |
2225 |
OperatingSystem |
|
2226 |
exec:'/bin/ls' |
|
2227 |
withArguments:#('ls' '/tmp') |
|
2228 |
fork:false. |
|
2229 |
'not reached'. |
|
8587 | 2230 |
] |
2231 |
" |
|
2232 |
||
2233 |
" |
|
2234 |
|id| |
|
2235 |
||
2236 |
id := OperatingSystem fork. |
|
2237 |
id == 0 ifTrue:[ |
|
13891 | 2238 |
'I am the child'. |
2239 |
OperatingSystem |
|
2240 |
exec:'/bin/sh' |
|
2241 |
withArguments:#('sh' '-c' 'sleep 2;echo 1;sleep 2;echo 2') |
|
2242 |
fork:false. |
|
2243 |
'not reached'. |
|
8587 | 2244 |
]. |
2245 |
id printNL. |
|
2246 |
(Delay forSeconds:3.5) wait. |
|
2247 |
'killing ...' printNL. |
|
2248 |
OperatingSystem sendSignal:(OperatingSystem sigTERM) to:id. |
|
2249 |
OperatingSystem sendSignal:(OperatingSystem sigKILL) to:id |
|
2250 |
" |
|
2251 |
||
2252 |
"Modified: / 15.7.1997 / 15:54:32 / stefan" |
|
2253 |
"Modified: / 12.11.1998 / 14:44:46 / cg" |
|
2254 |
! |
|
2255 |
||
2256 |
exec:aCommandPath withArguments:argArray fork:doFork inDirectory:aDirectory |
|
2257 |
"execute an OS command without I/O redirection. |
|
2258 |
The command reads its input and writes its output |
|
2259 |
from/to whatever terminal device ST/X was started |
|
2260 |
(typically, the terminal window)" |
|
2261 |
||
8669 | 2262 |
^ self |
13891 | 2263 |
exec:aCommandPath |
2264 |
withArguments:argArray |
|
2265 |
environment:nil |
|
2266 |
fileDescriptors:#(0 1 2) |
|
2267 |
fork:doFork |
|
2268 |
newPgrp:false |
|
2269 |
inDirectory:aDirectory |
|
8587 | 2270 |
|
2271 |
" |
|
2272 |
|id| |
|
2273 |
||
2274 |
id := OperatingSystem fork. |
|
2275 |
id == 0 ifTrue:[ |
|
13891 | 2276 |
'I am the child'. |
2277 |
OperatingSystem |
|
2278 |
exec:'/bin/ls' |
|
2279 |
withArguments:#('ls' '/tmp') |
|
2280 |
fork:false. |
|
2281 |
'not reached'. |
|
8587 | 2282 |
] |
2283 |
" |
|
2284 |
||
2285 |
" |
|
2286 |
|id| |
|
2287 |
||
2288 |
id := OperatingSystem fork. |
|
2289 |
id == 0 ifTrue:[ |
|
13891 | 2290 |
'I am the child'. |
2291 |
OperatingSystem |
|
2292 |
exec:'/bin/sh' |
|
2293 |
withArguments:#('sh' '-c' 'sleep 2;echo 1;sleep 2;echo 2') |
|
2294 |
fork:false. |
|
2295 |
'not reached'. |
|
8587 | 2296 |
]. |
2297 |
id printNL. |
|
2298 |
(Delay forSeconds:3.5) wait. |
|
2299 |
'killing ...' printNL. |
|
2300 |
OperatingSystem sendSignal:(OperatingSystem sigTERM) to:id. |
|
2301 |
OperatingSystem sendSignal:(OperatingSystem sigKILL) to:id |
|
2302 |
" |
|
2303 |
||
2304 |
"Created: / 28.1.1998 / 14:14:03 / md" |
|
2305 |
"Modified: / 28.1.1998 / 14:14:45 / md" |
|
2306 |
"Modified: / 12.11.1998 / 14:45:06 / cg" |
|
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
2307 |
! ! |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
2308 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2309 |
!AbstractOperatingSystem class methodsFor:'file access'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2310 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2311 |
closeFd:anInteger |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2312 |
"low level close of a filedescriptor" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2313 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2314 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2315 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2316 |
|
7699 | 2317 |
copyFromFd:inFd toFd:outFd startIndex:startIdx count:count |
2318 |
"directly copy from one FD to another (if supported by the OS)" |
|
2319 |
||
2320 |
^ 0 "/ not supported |
|
2321 |
! |
|
2322 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2323 |
createDirectory:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2324 |
"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
|
2325 |
path, or relative to the current directory. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2326 |
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
|
2327 |
This is a low-level entry - use Filename protocol for compatibility." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2328 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2329 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2330 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2331 |
|
6292 | 2332 |
createFileForReadAppend:pathName |
2333 |
self subclassResponsibility |
|
2334 |
! |
|
2335 |
||
2336 |
createFileForReadWrite:pathName |
|
2337 |
self subclassResponsibility |
|
2338 |
! |
|
2339 |
||
3758
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2340 |
createHardLinkFrom:oldPath to:newPath |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2341 |
"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
|
2342 |
Return true if successful, false if not." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2343 |
|
3758
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2344 |
"/ |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2345 |
"/ assume that this OperatingSystem does not support links |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2346 |
"/ |
18356
1312e3a2100b
lazy fetch of error signals
Claus Gittinger <cg@exept.de>
parents:
18303
diff
changeset
|
2347 |
^ self unsupportedOperationSignal raise |
3758
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2348 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2349 |
"Created: / 13.8.1998 / 21:37:12 / cg" |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2350 |
"Modified: / 13.8.1998 / 21:38:39 / cg" |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2351 |
! |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2352 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2353 |
createSymbolicLinkFrom:oldPath to:newPath |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2354 |
"make a link from the file 'oldPath' to the file 'newPath'. |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2355 |
The link will be a soft (symbolic) link. |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2356 |
Return true if successful, false if not." |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2357 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2358 |
"/ |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2359 |
"/ assume that this OperatingSystem does not support symbolic links |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2360 |
"/ |
18356
1312e3a2100b
lazy fetch of error signals
Claus Gittinger <cg@exept.de>
parents:
18303
diff
changeset
|
2361 |
^ self unsupportedOperationSignal raise |
3758
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2362 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2363 |
"Created: / 13.8.1998 / 21:38:24 / cg" |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2364 |
"Modified: / 13.8.1998 / 21:38:43 / cg" |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2365 |
! |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2366 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2367 |
linkFile:oldPath to:newPath |
17145
6b7f5e0a0434
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17030
diff
changeset
|
2368 |
<resource: #obsolete> |
3758
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2369 |
"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
|
2370 |
Return true if successful, false if not. |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2371 |
This method has been renamed - it remains in existance for |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2372 |
backward compatibility." |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2373 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2374 |
^ self createHardLinkFrom:oldPath to:newPath |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2375 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2376 |
" |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2377 |
OperatingSystem linkFile:'foo' to:'bar' |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2378 |
" |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2379 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2380 |
"Modified: / 13.8.1998 / 21:37:24 / cg" |
3576
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 |
|
6292 | 2383 |
openFileForAppend:pathName |
2384 |
self subclassResponsibility |
|
2385 |
! |
|
2386 |
||
2387 |
openFileForRead:pathName |
|
2388 |
self subclassResponsibility |
|
2389 |
! |
|
2390 |
||
2391 |
openFileForReadAppend:pathName |
|
2392 |
self subclassResponsibility |
|
2393 |
! |
|
2394 |
||
2395 |
openFileForReadWrite:pathName |
|
2396 |
self subclassResponsibility |
|
2397 |
! |
|
2398 |
||
2399 |
openFileForWrite:pathName |
|
2400 |
self subclassResponsibility |
|
2401 |
! |
|
2402 |
||
4149 | 2403 |
recursiveCopyDirectory:fullPathName to:destinationPathName |
8669 | 2404 |
"copy the directory named 'fullPathName' and all contained |
4149 | 2405 |
files/directories recursively to destinationPathName. |
2406 |
Return true if successful. |
|
2407 |
Here, false is returned and the caller should be prepared |
|
2408 |
for a fallBack solution. |
|
8669 | 2409 |
Notice: |
13891 | 2410 |
this is not a public interface; instead, it is used |
2411 |
internally by the Filename class, to try a fast copy |
|
2412 |
before doing things manually. |
|
2413 |
Please use Filename recursiveCopyTo:" |
|
4149 | 2414 |
|
2415 |
^ false |
|
2416 |
||
2417 |
" |
|
2418 |
OperatingSystem recursiveCopyDirectory:'.' to:'/tmp/foo' |
|
2419 |
OperatingSystem recursiveRemoveDirectory:'/tmp/foo' |
|
2420 |
" |
|
2421 |
||
2422 |
"Modified: / 5.5.1999 / 13:29:16 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2423 |
! |
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 |
recursiveCreateDirectory:dirName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2426 |
"create a directory - with all parent dirs if needed. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2427 |
Return true if successful, false otherwise. If false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2428 |
is returned, a partial created tree may be left, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2429 |
which is not cleaned-up here." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2430 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2431 |
self createDirectory:dirName. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2432 |
(self isDirectory:dirName) ifFalse:[ |
13891 | 2433 |
(self recursiveCreateDirectory:(dirName asFilename directoryName)) ifFalse:[^ false]. |
2434 |
^ self createDirectory:dirName |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2435 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2436 |
^ true |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2437 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2438 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2439 |
OperatingSystem recursiveCreateDirectory:'foo/bar/baz' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2440 |
OperatingSystem recursiveRemoveDirectory:'foo' |
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 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2443 |
"Modified: 7.3.1996 / 15:26:22 / cg" |
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 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2446 |
recursiveRemoveDirectory:fullPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2447 |
"remove the directory named 'fullPathName' and all contained files/directories. |
4149 | 2448 |
Return true if successful. |
2449 |
Here, false is returned and the caller should be prepared |
|
2450 |
for a fallBack solution. |
|
8669 | 2451 |
Notice: |
13891 | 2452 |
this is not a public interface; instead, it is used |
2453 |
internally by the Filename class, to try a fast remove |
|
2454 |
before doing things manually. |
|
2455 |
Please use Filename recursiveRemoveDirectory:" |
|
4149 | 2456 |
|
2457 |
^ false |
|
3576
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 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2460 |
OperatingSystem recursiveCreateDirectory:'foo/bar/baz' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2461 |
OperatingSystem recursiveRemoveDirectory:'foo' |
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 |
|
4149 | 2464 |
"Modified: / 5.5.1999 / 13:30:11 / cg" |
3576
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 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2467 |
removeDirectory:fullPathName |
8669 | 2468 |
"remove the directory named 'fullPathName'. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2469 |
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
|
2470 |
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
|
2471 |
This is a lowLevel entry - use Filename protocol for compatibility." |
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 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2474 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2475 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2476 |
removeFile:fullPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2477 |
"remove the file named 'fullPathName'; return true if successful. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2478 |
This is a lowLevel entry - use Filename protocol for compatibility." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2479 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2480 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2481 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2482 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2483 |
renameFile:oldPath to:newPath |
8669 | 2484 |
"rename the file 'oldPath' to 'newPath'. |
2485 |
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
|
2486 |
correct for the OS used - therefore, this should not be called |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2487 |
directlt. Instead, use Filename protocol to rename; this cares for |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2488 |
any invalid names. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2489 |
Returns true if successful, false if not" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2490 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2491 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2492 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2493 |
|
17147
b4cec8794fb8
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17145
diff
changeset
|
2494 |
sync |
b4cec8794fb8
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17145
diff
changeset
|
2495 |
"sync the filesystems - redefined in subclasses" |
b4cec8794fb8
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17145
diff
changeset
|
2496 |
! |
b4cec8794fb8
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17145
diff
changeset
|
2497 |
|
17150
c31831f471e8
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17147
diff
changeset
|
2498 |
syncFileSystem:handle |
c31831f471e8
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17147
diff
changeset
|
2499 |
"sync the filesystem where the file represented by handle resides" |
c31831f471e8
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17147
diff
changeset
|
2500 |
|
c31831f471e8
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17147
diff
changeset
|
2501 |
"default is to do a global sync" |
c31831f471e8
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17147
diff
changeset
|
2502 |
self sync. |
c31831f471e8
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17147
diff
changeset
|
2503 |
! |
c31831f471e8
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17147
diff
changeset
|
2504 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2505 |
truncateFile:aPathName to:newSize |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2506 |
"change a files size return true on success, false on failure. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2507 |
This may not be supported on all architectures. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2508 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2509 |
This is a low-level entry - use Filename protocol." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2510 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2511 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2512 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2513 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2514 |
!AbstractOperatingSystem class methodsFor:'file access rights'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2515 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2516 |
accessMaskFor:aSymbol |
8669 | 2517 |
"return the access bits mask for numbers as returned by |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2518 |
OperatingSystem>>accessModeOf: |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2519 |
and expected by OperatingSystem>>changeAccessModeOf:to:. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2520 |
Since these numbers are OS dependent, always use the mask |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2521 |
(never hardcode 8rxxx into your code)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2522 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2523 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2524 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2525 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2526 |
accessModeOf:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2527 |
"return a number representing access rights rwxrwxrwx for owner, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2528 |
group and others. Return nil if such a file does not exist. |
8669 | 2529 |
Notice that the returned number is OS dependent - use the |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2530 |
modeMasks as returned by OperatingSystem>>accessMaskFor:" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2531 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2532 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2533 |
this could have been implemented as: |
13891 | 2534 |
(self infoOf:aPathName) at:#mode |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2535 |
but for huge directory searches the code below is faster |
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 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2538 |
^ (self infoOf:aPathName) at:#mode |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2539 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2540 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2541 |
(OperatingSystem accessModeOf:'/') printStringRadix:8 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2542 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2543 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2544 |
|
15491
bb2780950dd1
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15471
diff
changeset
|
2545 |
accessModeOfFd:aFileDescriptor |
bb2780950dd1
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15471
diff
changeset
|
2546 |
"return a number representing access rights rwxrwxrwx for owner, |
bb2780950dd1
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15471
diff
changeset
|
2547 |
group and others. Return nil if such a file does not exist. |
bb2780950dd1
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15471
diff
changeset
|
2548 |
Notice that the returned number is OS dependent - use the |
bb2780950dd1
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15471
diff
changeset
|
2549 |
modeMasks as returned by OperatingSystem>>accessMaskFor:" |
bb2780950dd1
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15471
diff
changeset
|
2550 |
|
bb2780950dd1
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15471
diff
changeset
|
2551 |
^ self subclassResponsibility |
bb2780950dd1
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15471
diff
changeset
|
2552 |
! |
bb2780950dd1
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15471
diff
changeset
|
2553 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2554 |
changeAccessModeOf:aPathName to:modeBits |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2555 |
"change the access rights of aPathName to the OS dependent modeBits. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2556 |
You should construct this mask using accessMaskFor, to be OS |
8669 | 2557 |
independent. Return true if changed, |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2558 |
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
|
2559 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2560 |
self subclassResponsibility |
15491
bb2780950dd1
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15471
diff
changeset
|
2561 |
! |
bb2780950dd1
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15471
diff
changeset
|
2562 |
|
bb2780950dd1
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15471
diff
changeset
|
2563 |
changeAccessModeOfFd:aFileDescriptor to:modeBits |
bb2780950dd1
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15471
diff
changeset
|
2564 |
"change the access rights of the file referenced by aFileDescriptor |
bb2780950dd1
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15471
diff
changeset
|
2565 |
to the OS dependent modeBits. |
bb2780950dd1
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15471
diff
changeset
|
2566 |
You should construct this mask using accessMaskFor, to be OS |
bb2780950dd1
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15471
diff
changeset
|
2567 |
independent. Return true if changed, |
bb2780950dd1
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15471
diff
changeset
|
2568 |
false if such a file does not exist or change was not allowd." |
bb2780950dd1
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15471
diff
changeset
|
2569 |
|
bb2780950dd1
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15471
diff
changeset
|
2570 |
^ self subclassResponsibility |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2571 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2572 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2573 |
!AbstractOperatingSystem class methodsFor:'file locking'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2574 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2575 |
lockFD:aFileDescriptor shared:isSharedReadLock blocking:blockIfLocked |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2576 |
"set a lock on the file represented by aFileDescriptor. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2577 |
(such as returned by ExternalStream>>fileDescriptor). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2578 |
On some systems, only advisory locks are available - |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2579 |
these depends on other accessors to also perform the locking operation. |
8669 | 2580 |
If they do not, they may still access the file |
2581 |
(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
|
2582 |
The isSharedReadLock argument (if true) specifies if multiple readers |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2583 |
are to be allowed - if false, they are not. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2584 |
On some systems, all locks are non-exclusive locks. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2585 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2586 |
Returns true, if the lock was aquired, false otherwise. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2587 |
|
8669 | 2588 |
Notice, that not all OS's support these locks; |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2589 |
on some, this may simply be a no-op. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2590 |
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
|
2591 |
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
|
2592 |
argument." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2593 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2594 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2595 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2596 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2597 |
supportsFileLinks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2598 |
"return true, if the OS supports file links (hard links). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2599 |
Typically, only unix returns true here." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2600 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2601 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2602 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2603 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2604 |
supportsFileLocks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2605 |
"return true, if the OS supports file locking" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2606 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2607 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2608 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2609 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2610 |
OperatingSystem supportsFileLocks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2611 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2612 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2613 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2614 |
supportsNonBlockingFileLocks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2615 |
"return true, if the OS supports nonBlocking file locking |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2616 |
(i.e. with immediate return instead of waiting for the lock)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2617 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2618 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2619 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2620 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2621 |
OperatingSystem supportsNonBlockingFileLocks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2622 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2623 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2624 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2625 |
supportsSharedLocks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2626 |
"return true, if the OS supports shared (i.e. multiple reader) |
4147 | 2627 |
file locking. Assume false here - redefined in concrete classes." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2628 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2629 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2630 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2631 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2632 |
OperatingSystem supportsNonBlockingFileLocks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2633 |
" |
4147 | 2634 |
|
2635 |
"Modified: / 5.5.1999 / 01:08:03 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2636 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2637 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2638 |
supportsSymbolicLinks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2639 |
"return true, if the OS supports symbolic links on files/directories. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2640 |
Typically, only Unix returns true here" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2641 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2642 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2643 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2644 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2645 |
unlockFD:aFileDescriptor |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2646 |
"clear a file lock on the file represented by aFileDescriptor, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2647 |
which was previously aquired by #lockFD:. |
8669 | 2648 |
Return false, if the unlock failed |
2649 |
(which may happens when a wrong fd is passed, |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2650 |
no lock was set previously, or the systsem does not support locks). |
8669 | 2651 |
Notice, that not all OS's support file locks; |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2652 |
on some, this may simply be a no-op." |
8669 | 2653 |
|
3826 | 2654 |
^ false |
2655 |
||
2656 |
"Modified: / 10.9.1998 / 17:54:15 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2657 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2658 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2659 |
!AbstractOperatingSystem class methodsFor:'file queries'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2660 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2661 |
caseSensitiveFilenames |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2662 |
"return true, if the OS has caseSensitive file naming. |
8669 | 2663 |
On MSDOS, this will return false; |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2664 |
on a real OS, we return true." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2665 |
|
18277 | 2666 |
"/ actually, this query is too general, as it may depend on the mounted volume; |
2667 |
"/ so we need a query for a particular directory (and/or volume). |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2668 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2669 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2670 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2671 |
compressPath:pathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2672 |
"return the pathName compressed - that is, remove all ..-entries |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2673 |
and . entries. This does not always (in case of symbolic links) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2674 |
return the true pathName and is therefore used as a fallback |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2675 |
if realPath and popen failed." |
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 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2678 |
! |
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 |
directoryNameOf:aPath |
5861 | 2681 |
<resource:#obsolete> |
2682 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2683 |
self obsoleteMethodWarning:'use asFilename directoryName'. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2684 |
^ aPath asFilename directoryName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2685 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2686 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2687 |
fileSeparator |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2688 |
"return the character used to separate names in a path. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2689 |
This character differs for MSDOS and other systems, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2690 |
(but those are currently not supported - so this is some |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2691 |
preparation for the future)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2692 |
|
3736 | 2693 |
^ $/ "/ 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
|
2694 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2695 |
|
13111 | 2696 |
getCurrentDirectory |
2697 |
"get the current directory of the ST/X OS process" |
|
2698 |
||
2699 |
^ self subclassResponsibility |
|
2700 |
! |
|
2701 |
||
4224
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2702 |
getDiskInfoOf:aDirectoryPath |
8669 | 2703 |
"return some disk info. |
4224
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2704 |
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
|
2705 |
not guaranteed to be consistent across architectures. |
4226 | 2706 |
On unix and msdos, the information returned is (at least): |
13891 | 2707 |
freeBytes |
2708 |
totalBytes |
|
4224
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2709 |
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
|
2710 |
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
|
2711 |
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
|
2712 |
" |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2713 |
|
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2714 |
^ nil |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2715 |
|
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2716 |
" |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2717 |
OperatingSystem getDiskInfoOf:'/' |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2718 |
OperatingSystem getDiskInfoOf:'.' |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2719 |
" |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2720 |
|
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2721 |
"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
|
2722 |
! |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2723 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2724 |
getDriveList |
8669 | 2725 |
"return a list of volumes in the system. |
2726 |
On unix, no such thing like a volume exists |
|
2727 |
- there, a syntetic list with root, home & current is returned. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2728 |
On MSDOS, a list of drive letters is (eventually) returned. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2729 |
On VMS, a list of volumes is (eventually) returned." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2730 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2731 |
"/ |
4146 | 2732 |
"/ default: return an array filled with |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2733 |
"/ root, home and current directories. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2734 |
"/ |
8669 | 2735 |
^ Array |
13891 | 2736 |
with:'/' |
2737 |
with:(self getHomeDirectory) |
|
2738 |
with:(Filename currentDirectory pathName) |
|
4146 | 2739 |
|
2740 |
"Modified: / 5.5.1999 / 01:06:26 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2741 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2742 |
|
4852 | 2743 |
getMountedVolumes |
8669 | 2744 |
"return info about mounted volumes. |
4852 | 2745 |
The amount of information returned depends upon the OS, and is |
2746 |
not guaranteed to be consistent across architectures. |
|
2747 |
On unix, the information returned is (at least): |
|
13891 | 2748 |
mountPoint - mount point |
2749 |
fileSystem - device or NFS-remotePath |
|
4852 | 2750 |
" |
2751 |
||
2752 |
^ #() |
|
2753 |
||
2754 |
" |
|
2755 |
OperatingSystem getMountedVolumes |
|
2756 |
" |
|
2757 |
||
2758 |
"Modified: / 22.5.1999 / 00:36:06 / cg" |
|
2759 |
! |
|
2760 |
||
4200 | 2761 |
getNullDevice |
2762 |
"get the name of the null-device. Nil is returned if not supported" |
|
2763 |
||
2764 |
^ nil |
|
2765 |
||
2766 |
"Created: / 19.5.1999 / 12:24:59 / cg" |
|
2767 |
! |
|
2768 |
||
17680
bcf6a365b1a4
Added subclass responsibility for AbstractOperatingSystem>>#getObjectFileInfoFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17638
diff
changeset
|
2769 |
getObjectFileInfoFor: aStringOrFilename |
bcf6a365b1a4
Added subclass responsibility for AbstractOperatingSystem>>#getObjectFileInfoFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17638
diff
changeset
|
2770 |
"Return and info object for given executable or shared object |
bcf6a365b1a4
Added subclass responsibility for AbstractOperatingSystem>>#getObjectFileInfoFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17638
diff
changeset
|
2771 |
or throw an error if given file is not a valid an executable now |
bcf6a365b1a4
Added subclass responsibility for AbstractOperatingSystem>>#getObjectFileInfoFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17638
diff
changeset
|
2772 |
shared object. |
bcf6a365b1a4
Added subclass responsibility for AbstractOperatingSystem>>#getObjectFileInfoFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17638
diff
changeset
|
2773 |
|
bcf6a365b1a4
Added subclass responsibility for AbstractOperatingSystem>>#getObjectFileInfoFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17638
diff
changeset
|
2774 |
The info object returned is OS-specific, however it responds to at |
bcf6a365b1a4
Added subclass responsibility for AbstractOperatingSystem>>#getObjectFileInfoFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17638
diff
changeset
|
2775 |
least |
18186
59b07c61d875
compiler define for CLANG compiler
Claus Gittinger <cg@exept.de>
parents:
17680
diff
changeset
|
2776 |
#isFor32BitArchitecture |
59b07c61d875
compiler define for CLANG compiler
Claus Gittinger <cg@exept.de>
parents:
17680
diff
changeset
|
2777 |
#isFor64BitArchitecture ... returns true, if the given object is for |
59b07c61d875
compiler define for CLANG compiler
Claus Gittinger <cg@exept.de>
parents:
17680
diff
changeset
|
2778 |
32bit, 64bit architecture respectively |
17680
bcf6a365b1a4
Added subclass responsibility for AbstractOperatingSystem>>#getObjectFileInfoFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17638
diff
changeset
|
2779 |
" |
bcf6a365b1a4
Added subclass responsibility for AbstractOperatingSystem>>#getObjectFileInfoFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17638
diff
changeset
|
2780 |
^ self subclassResponsibility |
bcf6a365b1a4
Added subclass responsibility for AbstractOperatingSystem>>#getObjectFileInfoFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17638
diff
changeset
|
2781 |
|
bcf6a365b1a4
Added subclass responsibility for AbstractOperatingSystem>>#getObjectFileInfoFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17638
diff
changeset
|
2782 |
"Modified: / 26-03-2015 / 11:28:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
bcf6a365b1a4
Added subclass responsibility for AbstractOperatingSystem>>#getObjectFileInfoFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17638
diff
changeset
|
2783 |
! |
bcf6a365b1a4
Added subclass responsibility for AbstractOperatingSystem>>#getObjectFileInfoFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17638
diff
changeset
|
2784 |
|
16380
988bc273e265
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16372
diff
changeset
|
2785 |
getTrashDirectory |
988bc273e265
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16372
diff
changeset
|
2786 |
"get the name of a trash folder (if the OS supports it), |
988bc273e265
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16372
diff
changeset
|
2787 |
or nil, if not. |
988bc273e265
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16372
diff
changeset
|
2788 |
Must be redefined to return non nil in concrete operating systems" |
988bc273e265
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16372
diff
changeset
|
2789 |
|
988bc273e265
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16372
diff
changeset
|
2790 |
^ nil |
988bc273e265
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16372
diff
changeset
|
2791 |
! |
988bc273e265
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16372
diff
changeset
|
2792 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2793 |
idOf:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2794 |
"return the fileNumber (i.e. inode number) of a file. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2795 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2796 |
Not all operatingSystems may provide this - on those that do not, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2797 |
some dummy id will be returned. |
8669 | 2798 |
On unix, this information can be used to check for two files being |
2799 |
physically identical, even if found in different directories |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2800 |
(i.e. if they are hardLinked)." |
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 |
|i id| |
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 |
id := self primIdOf:aPathName. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2805 |
id notNil ifTrue:[^ id]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2806 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2807 |
i := self infoOf:aPathName. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2808 |
i notNil ifTrue:[^ i id]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2809 |
^ nil. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2810 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2811 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2812 |
OperatingSystem idOf:'/' |
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 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2815 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2816 |
infoOf:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2817 |
"return some object filled with info for the file 'aPathName'; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2818 |
the info (for which corresponding access methods are understood by |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2819 |
the returned object) is: |
16948 | 2820 |
type - a symbol giving the file's type |
2821 |
mode - numeric access mode |
|
2822 |
uid - owners user id |
|
2823 |
gid - owners group id |
|
2824 |
size - files size |
|
2825 |
id - files number (i.e. inode number) |
|
2826 |
accessed - last access time (as Timestamp) |
|
2827 |
modified - last modification time (as Timestamp) |
|
2828 |
statusChanged - last status change time (as Timestamp) |
|
2829 |
alternativeName - (windows only: the MSDOS name of the file) |
|
3576
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 |
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
|
2832 |
all of the information. |
8669 | 2833 |
Return nil if such a file does not exist. |
2834 |
For symbolic links (if supported by the OS), |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2835 |
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
|
2836 |
use #linkInfoOf: to get info about the link itself. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2837 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2838 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2839 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2840 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2841 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2842 |
isDirectory:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2843 |
"return true, if 'aPathName' is a valid directory path name. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2844 |
(i.e. exists and is a directory). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2845 |
This also returns true for symbolic links pointing to a directory; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2846 |
if you need to check for this, use #linkInfo:." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2847 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2848 |
^ (self infoOf:aPathName) type == #directory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2849 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2850 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2851 |
isExecutable:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2852 |
"return true, if the given file is executable. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2853 |
For symbolic links, the pointed-to-file is checked." |
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 |
self subclassResponsibility |
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 |
|
6772 | 2858 |
isMountPoint:aPathName |
6781 | 2859 |
"return true, if the given file is a mounted fileSystems mountPoint" |
2860 |
||
2861 |
^ self mountPoints contains:[:mountInfo | mountInfo mountPointPath = aPathName]. |
|
2862 |
||
2863 |
" |
|
8669 | 2864 |
OperatingSystem isMountPoint:'/phys/qnx' |
2865 |
OperatingSystem isMountPoint:'/proc' |
|
2866 |
OperatingSystem isMountPoint:'/' |
|
6781 | 2867 |
" |
6772 | 2868 |
! |
2869 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2870 |
isReadable:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2871 |
"return true, if the file/dir 'aPathName' is readable. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2872 |
For symbolic links, the pointed-to-file is checked." |
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 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2875 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2876 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2877 |
isSymbolicLink:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2878 |
"return true, if the given file is a symbolic link" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2879 |
|
8474
f06681e84c85
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
8468
diff
changeset
|
2880 |
|info| |
f06681e84c85
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
8468
diff
changeset
|
2881 |
|
f06681e84c85
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
8468
diff
changeset
|
2882 |
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
|
2883 |
^ 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
|
2884 |
|
f06681e84c85
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
8468
diff
changeset
|
2885 |
" |
f06681e84c85
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
8468
diff
changeset
|
2886 |
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
|
2887 |
OperatingSystem isSymbolicLink:'/usr/tmp' |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2888 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2889 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2890 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2891 |
isValidPath:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2892 |
"return true, if 'aPathName' is a valid path name |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2893 |
(i.e. the file or directory exists)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2894 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2895 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2896 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2897 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2898 |
isWritable:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2899 |
"return true, if the given file is writable. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2900 |
For symbolic links, the pointed-to-file is checked." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2901 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2902 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2903 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2904 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2905 |
linkInfoOf:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2906 |
"return a dictionary filled with info for the file 'aPathName', |
8669 | 2907 |
IFF aPathName is a symbolic link. |
15249
2bd69ec163af
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15207
diff
changeset
|
2908 |
If aPathName is invalid, nil is returned. |
2bd69ec163af
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15207
diff
changeset
|
2909 |
If aPathName is NOT a symbolic link, the #infoOf: aPathname itself is returned. |
2bd69ec163af
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15207
diff
changeset
|
2910 |
(which means, that systems like VMS or MSDOS always return the info here.) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2911 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2912 |
The contents of the dictionary gives info about the link itself, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2913 |
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
|
2914 |
in case of a symbolic link." |
8669 | 2915 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2916 |
self subclassResponsibility |
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 |
|
5031 | 2919 |
mimeTypeForFilename:aFilename |
2920 |
"given a filename, return a corresponding mimeType. |
|
2921 |
This is placed here, to allow for OS-specific configuration |
|
2922 |
files and/or the win32 registry to be consultet. |
|
2923 |
Returns nil if no mimeType for the given name is known." |
|
2924 |
||
2925 |
^ nil |
|
2926 |
! |
|
2927 |
||
4240
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2928 |
mimeTypeForSuffix:aFileSuffix |
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2929 |
"given a file suffix, return a corresponding mimeType. |
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2930 |
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
|
2931 |
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
|
2932 |
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
|
2933 |
|
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2934 |
^ nil |
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2935 |
! |
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2936 |
|
6781 | 2937 |
mountPoints |
2938 |
"return a collection of mountPoints (aka. topDirectories of mounted file systems)" |
|
2939 |
||
2940 |
^ #() "/ dont know here |
|
2941 |
! |
|
2942 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2943 |
parentDirectoryName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2944 |
"return the name used to refer to parent directories. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2945 |
In MSDOS, Unix and other systems this is '..', but maybe different |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2946 |
for other systems. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2947 |
(but those are currently not supported - so this is some |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2948 |
preparation for the future)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2949 |
|
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 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2952 |
|
16679
6538e17626c9
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16643
diff
changeset
|
2953 |
pathNameForDrive:driveName |
6538e17626c9
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16643
diff
changeset
|
2954 |
"given a drive name, return the pathname to open it as a directory. |
6538e17626c9
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16643
diff
changeset
|
2955 |
For Windows, this is the driveName itself. |
6538e17626c9
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16643
diff
changeset
|
2956 |
For OSX, '/Volumes' is prepended. |
6538e17626c9
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16643
diff
changeset
|
2957 |
Other OSs might prepent the pount point (i.e. /mnt/)" |
6538e17626c9
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16643
diff
changeset
|
2958 |
|
6538e17626c9
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16643
diff
changeset
|
2959 |
^ driveName |
6538e17626c9
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16643
diff
changeset
|
2960 |
! |
6538e17626c9
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16643
diff
changeset
|
2961 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2962 |
pathNameOf:pathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2963 |
"return the pathName of the argument, aPathString, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2964 |
- thats the full pathname of the directory, starting at '/'. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2965 |
This method needs the path to be valid |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2966 |
(i.e. all directories must exist, be readable and executable). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2967 |
Notice: if symbolic links are involved, the result may look different |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2968 |
from what you expect." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2969 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2970 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2971 |
! |
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 |
primIdOf:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2974 |
"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
|
2975 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2976 |
self subclassResponsibility |
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 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2979 |
timeOfLastAccess:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2980 |
"return the time, when the file was last accessed. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2981 |
For nonexistent files, nil is returned." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2982 |
|
8669 | 2983 |
^ (self infoOf:aPathName) accessTime |
3576
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 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2986 |
timeOfLastChange:aPathName |
8669 | 2987 |
"return the time, when the file was last changed. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2988 |
For nonexistent files, nil is returned." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2989 |
|
6793
0d3e3fd18a70
modified -> modificationTime
Claus Gittinger <cg@exept.de>
parents:
6781
diff
changeset
|
2990 |
^ (self infoOf:aPathName) modificationTime |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2991 |
! |
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 |
typeOf:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2994 |
"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
|
2995 |
nil is returned. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2996 |
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
|
2997 |
|
8669 | 2998 |
^ (self infoOf:aPathName) type |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2999 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3000 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3001 |
volumeNameOf:aPathString |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3002 |
"return the volumeName of the argument, aPath |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3003 |
- thats the name of the volume where aPath is. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3004 |
Not all OperatingSystems support/use volumes; on unix, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3005 |
this always returns an empty string." |
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 |
^ '' |
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 |
|
4200 | 3010 |
!AbstractOperatingSystem class methodsFor:'interprocess communication'! |
3011 |
||
3012 |
createCOMFileForVMSCommand:aCommandString in:aDirectory |
|
4204 | 3013 |
"this is only implemented/required for VMS systems, to execute commands" |
3014 |
||
18356
1312e3a2100b
lazy fetch of error signals
Claus Gittinger <cg@exept.de>
parents:
18303
diff
changeset
|
3015 |
^ self unsupportedOperationSignal raise |
4204 | 3016 |
|
4200 | 3017 |
"Created: / 19.5.1999 / 12:16:31 / cg" |
4204 | 3018 |
"Modified: / 19.5.1999 / 14:22:05 / cg" |
4200 | 3019 |
! |
3020 |
||
3021 |
createMailBox |
|
4204 | 3022 |
"this is only implemented/required for VMS systems, to emulate pipes" |
3023 |
||
18356
1312e3a2100b
lazy fetch of error signals
Claus Gittinger <cg@exept.de>
parents:
18303
diff
changeset
|
3024 |
^ self unsupportedOperationSignal raise |
4200 | 3025 |
|
3026 |
"Created: / 19.5.1999 / 12:14:56 / cg" |
|
4204 | 3027 |
"Modified: / 19.5.1999 / 14:22:22 / cg" |
4200 | 3028 |
! |
3029 |
||
3030 |
destroyMailBox:mbx |
|
4204 | 3031 |
"this is only implemented/required for VMS systems, to emulate pipes" |
3032 |
||
18356
1312e3a2100b
lazy fetch of error signals
Claus Gittinger <cg@exept.de>
parents:
18303
diff
changeset
|
3033 |
^ self unsupportedOperationSignal raise |
4204 | 3034 |
|
4200 | 3035 |
"Created: / 19.5.1999 / 12:16:43 / cg" |
4204 | 3036 |
"Modified: / 19.5.1999 / 14:22:33 / cg" |
4200 | 3037 |
! |
3038 |
||
3039 |
mailBoxNameOf:mbx |
|
4204 | 3040 |
"this is only implemented/required for VMS systems, to emulate pipes" |
3041 |
||
18356
1312e3a2100b
lazy fetch of error signals
Claus Gittinger <cg@exept.de>
parents:
18303
diff
changeset
|
3042 |
^ self unsupportedOperationSignal raise |
4200 | 3043 |
|
3044 |
"Created: / 19.5.1999 / 12:14:56 / cg" |
|
4204 | 3045 |
"Modified: / 19.5.1999 / 14:22:40 / cg" |
4200 | 3046 |
! |
3047 |
||
8967
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
3048 |
makeBidirectionalPipe |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
3049 |
"answer an array with 2 filedescriptors representing |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
3050 |
the two ends of a bidirectional pipe - see also #makePipe" |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
3051 |
|
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
3052 |
^ self subclassResponsibility |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
3053 |
! |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
3054 |
|
4200 | 3055 |
makePipe |
8967
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
3056 |
"answer an array with 2 filedescriptors representing |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
3057 |
the two ends of a unidirectional pipe- see also #makeSocketPair" |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
3058 |
|
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
3059 |
^ self subclassResponsibility |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
3060 |
! |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
3061 |
|
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
3062 |
shutdownBidirectionalPipeOutput:fileDescriptor |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
3063 |
"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
|
3064 |
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
|
3065 |
|
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
3066 |
^ self subclassResponsibility |
4200 | 3067 |
! ! |
3068 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3069 |
!AbstractOperatingSystem class methodsFor:'interrupts & signals'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3070 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3071 |
blockInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3072 |
"disable interrupt processing - if disabled, incoming |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3073 |
interrupts will be registered and handled as soon as |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3074 |
interrupts are reenabled by OperatingSystemclass>>unblockInterrupts. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3075 |
Returns the previous blocking status i.e. true if interrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3076 |
where already blocked. You need this information for proper |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3077 |
unblocking, in case of nested block/unblock calls." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3078 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3079 |
%{ /* NOCONTEXT */ |
18364 | 3080 |
#ifdef __SCHTEAM__ |
3081 |
return __c__._RETURN( __c__.blockInterrupts() ? STObject.True : STObject.False); |
|
3082 |
#else |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3083 |
RETURN ( __BLOCKINTERRUPTS() ); |
18364 | 3084 |
#endif /* not SCHTEAM */ |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3085 |
%} |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3086 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3087 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3088 |
defaultSignal:signalNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3089 |
"revert to the default action on arrival of a (Unix-)signal. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3090 |
Dont confuse Unix signals with smalltalk signals. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3091 |
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
|
3092 |
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
|
3093 |
default for SIGQUIT (^ \) is to dump core. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3094 |
Also, NOTICE that signal numbers are not portable between unix |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3095 |
systems - use OperatingSystem sigXXX to get the numeric value for |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3096 |
a signal." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3097 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3098 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3099 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3100 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3101 |
disableChildSignalInterrupts |
8669 | 3102 |
"disable childSignal interrupts |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3103 |
(SIGCHLD, if the architecture supports it). |
8669 | 3104 |
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
|
3105 |
SIGCHLD breaks wait & co" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3106 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3107 |
^ self defaultSignal:(self sigCHLD) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3108 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3109 |
"Created: 5.1.1996 / 15:45:28 / stefan" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3110 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3111 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3112 |
disableIOInterruptsOn:fd |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3113 |
"turn off IO interrupts for a filedescriptor" |
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 |
self subclassResponsibility |
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 |
disableSignal:signalNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3119 |
"disable (Unix-) signal processing for signalNumber. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3120 |
Dont confuse Unix signals with smalltalk signals. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3121 |
WARNING: for some signals, it is no good idea to disable |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3122 |
them; for example, disabling the SIGINT signal turns off ^C |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3123 |
handling. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3124 |
Also, NOTICE that signal numbers are not portable between unix |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3125 |
systems - use OperatingSystem sigXXX to get the numeric value for |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3126 |
a signal. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3127 |
Use only for fully debugged stand alone applications." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3128 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3129 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3130 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3131 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3132 |
disableTimer |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3133 |
"disable timer interrupts. |
8669 | 3134 |
WARNING: |
13891 | 3135 |
the system will not operate correctly with timer interrupts |
3136 |
disabled, because no scheduling or timeouts are possible." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3137 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3138 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3139 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3140 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3141 |
disableUserInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3142 |
"disable userInterrupt processing; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3143 |
when disabled, no ^C processing takes place. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3144 |
WARNING: |
13891 | 3145 |
If at all, use this only for debugged stand-alone applications, since |
3146 |
no exit to the debugger is possible with user interrupts disabled. |
|
3147 |
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
|
3148 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3149 |
self disableSignal:(self sigBREAK). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3150 |
self disableSignal:(self sigINT). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3151 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3152 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3153 |
enableAbortInterrupts |
14806
8d7786e5d9cd
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14801
diff
changeset
|
3154 |
"enable SIGABRT signal handling, and make it a regular signalInterrupt. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3155 |
(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
|
3156 |
end-user applications ...). |
14806
8d7786e5d9cd
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14801
diff
changeset
|
3157 |
After enabling, these exceptions will send the message |
8d7786e5d9cd
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14801
diff
changeset
|
3158 |
'signalInterrupt' to the SignalInterruptHandler object. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3159 |
This is especially useful, if linked-in C-libraries call abort() ..." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3160 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3161 |
self enableSignal:(self sigABRT) |
14806
8d7786e5d9cd
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14801
diff
changeset
|
3162 |
|
8d7786e5d9cd
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14801
diff
changeset
|
3163 |
" |
8d7786e5d9cd
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14801
diff
changeset
|
3164 |
OperatingSystem enableAbortInterrupts |
8d7786e5d9cd
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14801
diff
changeset
|
3165 |
" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3166 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3167 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3168 |
enableChildSignalInterrupts |
14806
8d7786e5d9cd
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14801
diff
changeset
|
3169 |
"enable child process interrupts |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3170 |
(SIGCHLD, if the architecture supports it). |
8669 | 3171 |
After enabling, these signals will send the message |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3172 |
'childSignalInterrupt' to the ChildSignalInterruptHandler object." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3173 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3174 |
self enableSignal:(self sigCHLD) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3175 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3176 |
|
6389 | 3177 |
enableCrashSignalInterrupts |
3178 |
"enable powerFail signal exception interrupts (sigPWR). |
|
3179 |
After enabling, this signal will trigger the writing of a crash-image" |
|
3180 |
||
3181 |
self enableSignal:(self sigPWR). |
|
3182 |
self enableSignal:(self sigHUP) |
|
3183 |
! |
|
3184 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3185 |
enableFpExceptionInterrupts |
14806
8d7786e5d9cd
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14801
diff
changeset
|
3186 |
"enable floating point exception interrupts (if the architecture supports it). |
8669 | 3187 |
After enabling, fpu-exceptions will send the message |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3188 |
'fpuExceptionInterrupt' to the FPUExceptionInterruptHandler object." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3189 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3190 |
self enableSignal:(self sigFP) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3191 |
! |
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 |
enableHardSignalInterrupts |
14806
8d7786e5d9cd
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14801
diff
changeset
|
3194 |
"enable hard signal exception interrupts (trap, bus error & segm. violation). |
8669 | 3195 |
After enabling, these exceptions will send the message |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3196 |
'signalInterrupt' to the SignalInterruptHandler object." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3197 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3198 |
"/ leads to trouble ... |
6389 | 3199 |
"/ self enableSignal:(self sigPIPE). |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3200 |
"/ ... better to ignore them, and let it be handled as a writeErrorSignal. |
6389 | 3201 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3202 |
self disableSignal:(self sigPIPE). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3203 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3204 |
self enableSignal:(self sigILL). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3205 |
self enableSignal:(self sigBUS). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3206 |
self enableSignal:(self sigSEGV). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3207 |
self enableSignal:(self sigFP). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3208 |
self enableSignal:(self sigEMT). |
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 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3211 |
enableIOInterruptsOn:fd |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3212 |
"turn on IO interrupts for a filedescriptor" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3213 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3214 |
self subclassResonsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3215 |
! |
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 |
enableQuitInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3218 |
"enable quitInterrupt (usually ^\) handling, and make it a userInterrupt. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3219 |
(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
|
3220 |
end-user applications ...)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3221 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3222 |
self enableSignal:(self sigQUIT) |
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 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3225 |
enableSignal:signalNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3226 |
"enable (Unix-)signal processing for signalNumber. |
8587 | 3227 |
Don't confuse Unix signals with smalltalk signals. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3228 |
The signal will be delivered to one of the standard handlers |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3229 |
(SIGINT, SIGQUIT, etc) or to a general handler, which |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3230 |
sends #signalInterrupt:. |
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 |
NOTICE that signal numbers are not portable between unix |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3233 |
systems - use OperatingSystem sigXXX to get the numeric value for |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3234 |
a signal." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3235 |
|
8587 | 3236 |
self subclassResponsibility |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3237 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3238 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3239 |
enableTimer:milliSeconds |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3240 |
"setup for a timerInterrupt, to be signalled after some (real) time." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3241 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3242 |
self subclassResonsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3243 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3244 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3245 |
enableUserInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3246 |
"enable userInterrupt (^C) handling; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3247 |
when enabled, ^C in the terminal window will send the message |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3248 |
'userInterrupt' to the UserInterruptHandler object." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3249 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3250 |
self enableSignal:(self sigINT). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3251 |
self enableSignal:(self sigBREAK). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3252 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3253 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3254 |
interruptPending |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3255 |
"return true, if an interrupt is pending. The returned value is |
8669 | 3256 |
invalid if interrupts are not currently blocked, since otherwise |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3257 |
the interrupt is usually already handled before arriving here, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3258 |
or may be served while returning from here." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3259 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3260 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3261 |
extern OBJ __INTERRUPTPENDING(); |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3262 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3263 |
RETURN ( __INTERRUPTPENDING() ); |
8669 | 3264 |
%} |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3265 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3266 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3267 |
interruptsBlocked |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3268 |
"return true, if interrupt handling is currently disabled; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3269 |
false otherwise." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3270 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3271 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3272 |
extern OBJ __INTERRUPTS_BLOCKED(); |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3273 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3274 |
RETURN ( __INTERRUPTS_BLOCKED() ); |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3275 |
%} |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3276 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3277 |
|
6536 | 3278 |
isFatalSignal:aNumber |
3279 |
"return true if a signal with number aNumber is a fatal signal, |
|
3280 |
i.e. some severe internal error occured" |
|
3281 |
||
3282 |
^ self subclassResponsibility |
|
3283 |
! |
|
3284 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3285 |
killProcess:processId |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3286 |
"kill an OS process. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3287 |
The process has a no chance to do some cleanup. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3288 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3289 |
WARNING: in order to avoid zombie processes (on unix), |
13891 | 3290 |
you may have to fetch the processes exitstatus with |
3291 |
OperatingSystem>>getStatusOfProcess:aProcessId." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3292 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3293 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3294 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3295 |
"Modified: / 10.6.1998 / 12:00:07 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3296 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3297 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3298 |
killProcessGroup:processGroupId |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3299 |
"kill an OS process group. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3300 |
The process has NO chance to do some cleanup. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3301 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3302 |
WARNING: in order to avoid zombie processes (on unix), |
13891 | 3303 |
you may have to fetch the processes exitstatus with |
3304 |
OperatingSystem>>getStatusOfProcess:aProcessId." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3305 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3306 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3307 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3308 |
"Created: / 10.6.1998 / 12:00:26 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3309 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3310 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3311 |
nameForSignal:aSignalNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3312 |
"for a given Unix signalnumber, return a descriptive string" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3313 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3314 |
aSignalNumber == self sigHUP ifTrue:[^ 'hangup']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3315 |
aSignalNumber == self sigINT ifTrue:[^ 'interrupt']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3316 |
aSignalNumber == self sigKILL ifTrue:[^ 'kill']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3317 |
aSignalNumber == self sigQUIT ifTrue:[^ 'quit']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3318 |
aSignalNumber == self sigILL ifTrue:[^ 'illegal instruction']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3319 |
aSignalNumber == self sigTRAP ifTrue:[^ 'trap']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3320 |
aSignalNumber == self sigABRT ifTrue:[^ 'abort']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3321 |
aSignalNumber == self sigIOT ifTrue:[^ 'iot trap']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3322 |
aSignalNumber == self sigEMT ifTrue:[^ 'emt trap']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3323 |
aSignalNumber == self sigFP ifTrue:[^ 'fp exception']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3324 |
aSignalNumber == self sigBUS ifTrue:[^ 'bus error']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3325 |
aSignalNumber == self sigSEGV ifTrue:[^ 'segmentation violation']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3326 |
aSignalNumber == self sigSYS ifTrue:[^ 'bad system call']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3327 |
aSignalNumber == self sigPIPE ifTrue:[^ 'broken pipe']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3328 |
aSignalNumber == self sigALRM ifTrue:[^ 'alarm timer']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3329 |
aSignalNumber == self sigTERM ifTrue:[^ 'termination']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3330 |
aSignalNumber == self sigSTOP ifTrue:[^ 'stop']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3331 |
aSignalNumber == self sigTSTP ifTrue:[^ 'tty stop']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3332 |
aSignalNumber == self sigCONT ifTrue:[^ 'continue']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3333 |
aSignalNumber == self sigCHLD ifTrue:[^ 'child death']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3334 |
aSignalNumber == self sigTTIN ifTrue:[^ 'background tty input']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3335 |
aSignalNumber == self sigTTOU ifTrue:[^ 'background tty output']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3336 |
aSignalNumber == self sigIO ifTrue:[^ 'io available']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3337 |
aSignalNumber == self sigXCPU ifTrue:[^ 'cpu time expired']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3338 |
aSignalNumber == self sigXFSZ ifTrue:[^ 'file size limit']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3339 |
aSignalNumber == self sigVTALRM ifTrue:[^ 'virtual alarm timer']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3340 |
aSignalNumber == self sigPROF ifTrue:[^ 'profiling timer']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3341 |
aSignalNumber == self sigWINCH ifTrue:[^ 'winsize changed']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3342 |
aSignalNumber == self sigLOST ifTrue:[^ 'resource lost']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3343 |
aSignalNumber == self sigUSR1 ifTrue:[^ 'user signal 1']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3344 |
aSignalNumber == self sigUSR2 ifTrue:[^ 'user signal 2']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3345 |
aSignalNumber == self sigMSG ifTrue:[^ 'HFT message']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3346 |
aSignalNumber == self sigPWR ifTrue:[^ 'power-fail']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3347 |
aSignalNumber == self sigPRE ifTrue:[^ 'programming exception']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3348 |
aSignalNumber == self sigGRANT ifTrue:[^ 'HFT access wanted']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3349 |
aSignalNumber == self sigRETRACT ifTrue:[^ 'HFT access relinquish']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3350 |
aSignalNumber == self sigSOUND ifTrue:[^ 'HFT sound complete']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3351 |
aSignalNumber == self sigDANGER ifTrue:[^ 'low on paging space']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3352 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3353 |
"notice: many systems map SIGPOLL and/or SIGUSR onto SIGIO |
13891 | 3354 |
therefore, keep SIGIO always above the two below" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3355 |
aSignalNumber == self sigPOLL ifTrue:[^ 'io available']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3356 |
aSignalNumber == self sigURG ifTrue:[^ 'urgent']. |
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 |
^ 'unknown signal' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3359 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3360 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3361 |
OperatingSystem nameForSignal:9 |
8669 | 3362 |
OperatingSystem nameForSignal:(OperatingSystem sigPOLL) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3363 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3364 |
! |
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 |
operatingSystemSignal:signalNumber |
8669 | 3367 |
"return the signal to be raised when an |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3368 |
operatingSystem-signal occurs, or nil" |
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 |
OSSignals notNil ifTrue:[ |
13891 | 3371 |
^ OSSignals at:signalNumber ifAbsent:[nil] |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3372 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3373 |
^ nil |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3374 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3375 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3376 |
operatingSystemSignal:signalNumber install:aSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3377 |
"install a signal to be raised when an operatingSystem-signal occurs" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3378 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3379 |
OSSignals isNil ifTrue:[ |
13891 | 3380 |
OSSignals := Array new:32 |
3576
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 |
OSSignals at:signalNumber put:aSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3383 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3384 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3385 |
sendSignal:signalNumber to:processId |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3386 |
"send a unix signal to some process (maybe myself). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3387 |
Returns false if any error occurred, true otherwise. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3388 |
|
8587 | 3389 |
Do not confuse UNIX signals with Smalltalk-Signals." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3390 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3391 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3392 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3393 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3394 |
startSpyTimer |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3395 |
"trigger a spyInterrupt, to be signalled after some short (virtual) time. |
4200 | 3396 |
Return true, if the spy-timerInterrupt was enabled. |
3397 |
This was used by the old MessageTally for profiling. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3398 |
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
|
3399 |
(which is of course less correct). |
8669 | 3400 |
OBSOLETE: the new messageTally runs as a high prio process, not using |
13891 | 3401 |
spy interrupts." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3402 |
|
4200 | 3403 |
^ false |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3404 |
! |
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 |
stopSpyTimer |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3407 |
"stop spy timing - disable spy timer. |
8669 | 3408 |
OBSOLETE: the new messageTally runs as a high prio process, not using |
13891 | 3409 |
spy interrupts." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3410 |
|
4200 | 3411 |
^ false |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3412 |
! |
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 |
terminateProcess:processId |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3415 |
"terminate a unix process. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3416 |
The process has a chance to do some cleanup. |
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 |
WARNING: in order to avoid zombie processes (on unix), |
13891 | 3419 |
you may have to fetch the processes exitstatus with |
3420 |
OperatingSystem>>getStatusOfProcess:aProcessId." |
|
3576
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 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3423 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3424 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3425 |
terminateProcessGroup:processGroupId |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3426 |
"terminate a unix process group. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3427 |
The process has a chance to do some cleanup. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3428 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3429 |
WARNING: in order to avoid zombie processes (on unix), |
13891 | 3430 |
you may have to fetch the processes exitstatus with |
3431 |
OperatingSystem>>getStatusOfProcess:aProcessId." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3432 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3433 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3434 |
! |
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 |
unblockInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3437 |
"enable interrupt processing - if any interrupts are pending, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3438 |
these will be handled immediately. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3439 |
When unblocking interrupts, take care of nested block/unblock |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3440 |
calls - you must only unblock after a blockcall if they where |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3441 |
really not blocked before. See OperatingSystemclass>>blockInterrupts." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3442 |
%{ |
18364 | 3443 |
#ifdef __SCHTEAM__ |
3444 |
return __c__._RETURN( __c__.unblockInterrupts() ? STObject.True : STObject.False); |
|
3445 |
#else |
|
8505
4456ffd20005
#unblockInterrupts returns the prvious blocking state
Stefan Vogel <sv@exept.de>
parents:
8497
diff
changeset
|
3446 |
RETURN(__UNBLOCKINTERRUPTS()); |
18364 | 3447 |
#endif |
3576
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 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3451 |
!AbstractOperatingSystem class methodsFor:'misc'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3452 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3453 |
closePid:pid |
16372
246ccdafca3c
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16335
diff
changeset
|
3454 |
"free pid resource. |
246ccdafca3c
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16335
diff
changeset
|
3455 |
Not required for Unix, but Windoze requires it." |
246ccdafca3c
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16335
diff
changeset
|
3456 |
|
246ccdafca3c
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16335
diff
changeset
|
3457 |
^ true. |
246ccdafca3c
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16335
diff
changeset
|
3458 |
|
246ccdafca3c
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16335
diff
changeset
|
3459 |
"Created: / 28.1.1998 / 14:23:04 / md" |
246ccdafca3c
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16335
diff
changeset
|
3460 |
"Modified: / 28.1.1998 / 14:27:18 / md" |
246ccdafca3c
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16335
diff
changeset
|
3461 |
"Modified: / 5.6.1998 / 18:38:46 / cg" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3462 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3463 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3464 |
exit |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3465 |
"shutdown smalltalk immediately - this method does not return. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3466 |
Return 'good'-status (0) to the parent unix process." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3467 |
|
5429 | 3468 |
self exit:0. |
3469 |
||
8804 | 3470 |
"OperatingSystem exit - don't evaluate this" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3471 |
! |
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 |
exit:exitCode |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3474 |
"shutdown smalltalk immediately - |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3475 |
returning an exit-code to the parent unix process." |
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 |
%{ /* NOCONTEXT */ |
18303
3168be747a94
exit for schteamCVS: ----------------------------------------------------------------------
Claus Gittinger <cg@exept.de>
parents:
18277
diff
changeset
|
3478 |
#ifdef __SCHTEAM__ |
3168be747a94
exit for schteamCVS: ----------------------------------------------------------------------
Claus Gittinger <cg@exept.de>
parents:
18277
diff
changeset
|
3479 |
int code = 1; |
3168be747a94
exit for schteamCVS: ----------------------------------------------------------------------
Claus Gittinger <cg@exept.de>
parents:
18277
diff
changeset
|
3480 |
|
3168be747a94
exit for schteamCVS: ----------------------------------------------------------------------
Claus Gittinger <cg@exept.de>
parents:
18277
diff
changeset
|
3481 |
if (exitCode.isSmallInteger()) { |
3168be747a94
exit for schteamCVS: ----------------------------------------------------------------------
Claus Gittinger <cg@exept.de>
parents:
18277
diff
changeset
|
3482 |
code = exitCode.intValue(); |
3168be747a94
exit for schteamCVS: ----------------------------------------------------------------------
Claus Gittinger <cg@exept.de>
parents:
18277
diff
changeset
|
3483 |
} |
3168be747a94
exit for schteamCVS: ----------------------------------------------------------------------
Claus Gittinger <cg@exept.de>
parents:
18277
diff
changeset
|
3484 |
STMain.mainExit(code); |
3168be747a94
exit for schteamCVS: ----------------------------------------------------------------------
Claus Gittinger <cg@exept.de>
parents:
18277
diff
changeset
|
3485 |
#else |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3486 |
int code = 1; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3487 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3488 |
if (__isSmallInteger(exitCode)) { |
13891 | 3489 |
code = __intVal(exitCode); |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3490 |
} |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3491 |
__mainExit(code); |
18303
3168be747a94
exit for schteamCVS: ----------------------------------------------------------------------
Claus Gittinger <cg@exept.de>
parents:
18277
diff
changeset
|
3492 |
#endif |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3493 |
%} |
8804 | 3494 |
"OperatingSystem exit:1 - don't evaluate this" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3495 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3496 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3497 |
exitWithCoreDump |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3498 |
"shutdown smalltalk immediately - dumping core. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3499 |
This always returns 'bad'-status to the parent unix process. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3500 |
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
|
3501 |
manually remove any tempfiles. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3502 |
Use this only for debugging ST/X itself" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3503 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3504 |
%{ /* NOCONTEXT */ |
10293 | 3505 |
extern void abort(); |
3506 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3507 |
abort(); |
18303
3168be747a94
exit for schteamCVS: ----------------------------------------------------------------------
Claus Gittinger <cg@exept.de>
parents:
18277
diff
changeset
|
3508 |
%}. |
3168be747a94
exit for schteamCVS: ----------------------------------------------------------------------
Claus Gittinger <cg@exept.de>
parents:
18277
diff
changeset
|
3509 |
"/ fall back for systems without primitive C code |
3168be747a94
exit for schteamCVS: ----------------------------------------------------------------------
Claus Gittinger <cg@exept.de>
parents:
18277
diff
changeset
|
3510 |
self exit:1 |
3168be747a94
exit for schteamCVS: ----------------------------------------------------------------------
Claus Gittinger <cg@exept.de>
parents:
18277
diff
changeset
|
3511 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3512 |
" |
8804 | 3513 |
OperatingSystem exitWithCoreDump - don't evaluate this |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3514 |
" |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3515 |
! |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3516 |
|
13314 | 3517 |
getAllProcesses |
3518 |
"get a list of the running OS processes. |
|
3519 |
Some OperatingSystems (Windows) support this. |
|
3520 |
The default is to answer an empty list." |
|
3521 |
||
3522 |
^ #(). |
|
3523 |
! |
|
3524 |
||
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3525 |
getVMSSymbol:aSymbolString |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3526 |
"get a symbols value, or nil if there is none" |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3527 |
|
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3528 |
^ nil |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3529 |
|
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3530 |
"Created: / 5.6.1998 / 19:02:50 / cg" |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3531 |
"Modified: / 5.6.1998 / 19:03:15 / cg" |
11768 | 3532 |
! |
3533 |
||
3534 |
playSound:fileName |
|
3535 |
"unsupported - simply stay silent" |
|
3536 |
||
3537 |
^ self. |
|
3538 |
! |
|
3539 |
||
3540 |
playSound:fileName mode:modeInteger |
|
3541 |
"unsupported - simply stay silent" |
|
3542 |
||
3543 |
^ self. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3544 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3545 |
|
7289
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3546 |
!AbstractOperatingSystem class methodsFor:'obsolete'! |
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3547 |
|
8236 | 3548 |
baseNameOf:aPath |
3549 |
<resource:#obsolete> |
|
3550 |
||
3551 |
self obsoleteMethodWarning:'use asFilename baseName'. |
|
3552 |
^ aPath asFilename baseName |
|
17518
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3553 |
! |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3554 |
|
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3555 |
executeCommand:aCommandString onError:aBlock inDirectory:aDirectory |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3556 |
"OBSOLETE for backward compatibility. |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3557 |
execute the unix command specified by the argument, aCommandString. |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3558 |
The commandString is passed to a shell for execution - see the description of |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3559 |
'sh -c' in your UNIX manual. |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3560 |
Return true if successful, the value from aBlock if not. |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3561 |
If not successfull, aBlock is called with an OsProcessStatus |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3562 |
(containing the exit status) as argument." |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3563 |
|
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3564 |
<resource:#obsolete> |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3565 |
|
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3566 |
self obsoleteMethodWarning:'use executeCommand:inDirectory:onError:'. |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3567 |
|
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3568 |
^ self |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3569 |
executeCommand:aCommandString |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3570 |
inputFrom:nil |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3571 |
outputTo:nil |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3572 |
errorTo:nil |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3573 |
auxFrom:nil |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3574 |
environment:nil |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3575 |
inDirectory:aDirectory |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3576 |
lineWise:false |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3577 |
onError:aBlock |
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3578 |
|
78b73108d76d
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17431
diff
changeset
|
3579 |
"Modified: / 10.11.1998 / 20:54:37 / cg" |
7289
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3580 |
! ! |
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3581 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3582 |
!AbstractOperatingSystem class methodsFor:'os queries'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3583 |
|
3806 | 3584 |
getCCDefine |
3585 |
"return a string which was used to identify the C-Compiler used |
|
3586 |
when STX was compiled, and which should be passed down when compiling methods. |
|
8669 | 3587 |
For example, on linux, this is '__GNUC__'; |
3806 | 3588 |
on windows, this is either '__MSC__' or '__BORLANDC__'" |
3589 |
||
3590 |
%{ /* NOCONTEXT */ |
|
3591 |
#ifndef CC_DEFINE |
|
3592 |
# ifdef WIN32 |
|
14657 | 3593 |
# if defined( __BORLANDC__ ) |
3829 | 3594 |
# define CC_DEFINE "__BORLANDC__" |
14757 | 3595 |
# else |
3596 |
# if defined( __VISUALC__ ) |
|
3597 |
# define CC_DEFINE "__VISUALC__" |
|
3598 |
# else |
|
3599 |
# if defined( __MINGW64__ ) |
|
3600 |
# define CC_DEFINE "__MINGW64__" |
|
3601 |
# else |
|
3602 |
# if defined( __MINGW32__ ) |
|
3603 |
# define CC_DEFINE "__MINGW32__" |
|
3604 |
# else |
|
3605 |
# define CC_DEFINE "__CC__" |
|
3606 |
# endif |
|
3607 |
# endif |
|
3608 |
# endif |
|
3806 | 3609 |
# endif |
18186
59b07c61d875
compiler define for CLANG compiler
Claus Gittinger <cg@exept.de>
parents:
17680
diff
changeset
|
3610 |
# else /* not WIN32 */ |
59b07c61d875
compiler define for CLANG compiler
Claus Gittinger <cg@exept.de>
parents:
17680
diff
changeset
|
3611 |
# ifdef __clang__ |
59b07c61d875
compiler define for CLANG compiler
Claus Gittinger <cg@exept.de>
parents:
17680
diff
changeset
|
3612 |
# define CC_DEFINE "__clang__" |
3806 | 3613 |
# else |
18186
59b07c61d875
compiler define for CLANG compiler
Claus Gittinger <cg@exept.de>
parents:
17680
diff
changeset
|
3614 |
# ifdef __GNUC__ |
59b07c61d875
compiler define for CLANG compiler
Claus Gittinger <cg@exept.de>
parents:
17680
diff
changeset
|
3615 |
# define CC_DEFINE "__GNUC__" |
59b07c61d875
compiler define for CLANG compiler
Claus Gittinger <cg@exept.de>
parents:
17680
diff
changeset
|
3616 |
# else |
59b07c61d875
compiler define for CLANG compiler
Claus Gittinger <cg@exept.de>
parents:
17680
diff
changeset
|
3617 |
# define CC_DEFINE "__CC__" |
59b07c61d875
compiler define for CLANG compiler
Claus Gittinger <cg@exept.de>
parents:
17680
diff
changeset
|
3618 |
# endif |
3806 | 3619 |
# endif |
3620 |
# endif |
|
3621 |
#endif |
|
3622 |
RETURN ( __MKSTRING(CC_DEFINE)); |
|
3623 |
%} |
|
3624 |
" |
|
3625 |
OperatingSystem getCCDefine |
|
3626 |
" |
|
3627 |
! |
|
3628 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3629 |
getCPUDefine |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3630 |
"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
|
3631 |
compiled, and which should be passed down when compiling methods. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3632 |
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
|
3633 |
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
|
3634 |
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
|
3635 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3636 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3637 |
# ifndef CPU_DEFINE |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3638 |
# define CPU_DEFINE "-DunknownCPU" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3639 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3640 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3641 |
RETURN ( __MKSTRING(CPU_DEFINE)); |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3642 |
%} |
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 |
OperatingSystem getCPUDefine |
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 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3647 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3648 |
getCPUType |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3649 |
"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
|
3650 |
Here, the machine for which ST/X was compiled is returned |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3651 |
(i.e. for all x86's, the same i386 is returned). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3652 |
This may normally not be of any interest to you ..." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3653 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3654 |
|cpu| |
8669 | 3655 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3656 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3657 |
|
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3658 |
# ifdef __vax__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3659 |
# define CPU_SYMBOL @symbol(vax) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3660 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3661 |
# ifdef __mips__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3662 |
# define CPU_SYMBOL @symbol(mips) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3663 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3664 |
# ifdef __i386__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3665 |
# define CPU_SYMBOL @symbol(i386) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3666 |
# endif |
14657 | 3667 |
# ifdef __x86_64__ |
3668 |
# define CPU_SYMBOL @symbol(x86_64) |
|
3669 |
# endif |
|
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3670 |
# ifdef __i860__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3671 |
# define CPU_SYMBOL @symbol(i860) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3672 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3673 |
# ifdef __ns32k__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3674 |
# define CPU_SYMBOL @symbol(ns32k) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3675 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3676 |
# ifdef __mc68k__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3677 |
# define CPU_SYMBOL @symbol(mc68k) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3678 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3679 |
# ifdef __mc88k__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3680 |
# define CPU_SYMBOL @symbol(mc88k) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3681 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3682 |
# ifdef __sparc__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3683 |
# define CPU_SYMBOL @symbol(sparc) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3684 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3685 |
# ifdef __hppa__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3686 |
# define CPU_SYMBOL @symbol(hppa) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3687 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3688 |
# ifdef __rs6000__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3689 |
# define CPU_SYMBOL @symbol(rs6000) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3690 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3691 |
# ifdef __powerPC__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3692 |
# define CPU_SYMBOL @symbol(powerPC) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3693 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3694 |
# ifdef __alpha__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3695 |
# define CPU_SYMBOL @symbol(alpha) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3696 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3697 |
# ifdef __transputer__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3698 |
# define CPU_SYMBOL @symbol(transputer) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3699 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3700 |
# ifdef __ibm370__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3701 |
# define CPU_SYMBOL @symbol(ibm370) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3702 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3703 |
# ifdef __s390__ |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3704 |
# define CPU_SYMBOL @symbol(s390) |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3705 |
# endif |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3706 |
# ifdef __arm__ |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3707 |
# define CPU_SYMBOL @symbol(arm) |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3708 |
# endif |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3709 |
# ifdef __ia64__ |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3710 |
# define CPU_SYMBOL @symbol(ia64) |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3711 |
# endif |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3712 |
|
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3713 |
# ifndef CPU_SYMBOL |
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3714 |
# define CPU_SYMBOL @symbol(unknown) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3715 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3716 |
|
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3717 |
cpu = CPU_SYMBOL; |
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3718 |
# undef CPU_SYMBOL |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3719 |
%}. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3720 |
^ cpu |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3721 |
|
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 |
OperatingSystem getCPUType |
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 |
"examples: are we running on a ss-10/solaris ?" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3727 |
" |
8669 | 3728 |
(OperatingSystem getCPUType = 'sparc') |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3729 |
and:[OperatingSystem getOSType = 'solaris'] |
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 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3732 |
"or on a pc/solaris ?" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3733 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3734 |
(OperatingSystem getCPUType = 'i386') |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3735 |
and:[OperatingSystem getOSType = 'solaris'] |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3736 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3737 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3738 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3739 |
getDomainName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3740 |
"return the domain this host is in. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3741 |
Notice: |
13891 | 3742 |
not all systems support this; on some, 'unknown' is returned." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3743 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3744 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3745 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3746 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3747 |
getEnvironment:aStringOrSymbol |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3748 |
"get an environment string" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3749 |
|
5407 | 3750 |
^ self subclassResponsibility |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3751 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3752 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3753 |
getHostName |
13891 | 3754 |
"return the hostname we are running on - |
12959
4fc6924e462f
comment/format in: #getHostName
Stefan Vogel <sv@exept.de>
parents:
12826
diff
changeset
|
3755 |
a fully qalified hostname at best. |
4fc6924e462f
comment/format in: #getHostName
Stefan Vogel <sv@exept.de>
parents:
12826
diff
changeset
|
3756 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3757 |
Notice: |
13891 | 3758 |
not all systems support this; on some, 'unknown' is returned." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3759 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3760 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3761 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3762 |
|
7778
cbbd8c2faccc
Language stuff: define #getLanguage
Stefan Vogel <sv@exept.de>
parents:
7770
diff
changeset
|
3763 |
getLanguage |
cbbd8c2faccc
Language stuff: define #getLanguage
Stefan Vogel <sv@exept.de>
parents:
7770
diff
changeset
|
3764 |
"get the LANGUAGE setting (example: de_DE.iso8859-15@euro)" |
cbbd8c2faccc
Language stuff: define #getLanguage
Stefan Vogel <sv@exept.de>
parents:
7770
diff
changeset
|
3765 |
|
cbbd8c2faccc
Language stuff: define #getLanguage
Stefan Vogel <sv@exept.de>
parents:
7770
diff
changeset
|
3766 |
^ self getEnvironment:'LANG'. |
cbbd8c2faccc
Language stuff: define #getLanguage
Stefan Vogel <sv@exept.de>
parents:
7770
diff
changeset
|
3767 |
! |
cbbd8c2faccc
Language stuff: define #getLanguage
Stefan Vogel <sv@exept.de>
parents:
7770
diff
changeset
|
3768 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3769 |
getLocaleInfo |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3770 |
"return a dictionary filled with values from the locale information; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3771 |
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
|
3772 |
Possible fields are: |
13891 | 3773 |
decimalPoint <String> |
3774 |
||
3775 |
thousandsSep <String> |
|
3776 |
||
3777 |
internationalCurrencySymbol <String> |
|
3778 |
||
3779 |
currencySymbol <String> |
|
3780 |
||
3781 |
monetaryDecimalPoint <String> |
|
3782 |
||
3783 |
monetaryThousandsSeparator <String> |
|
3784 |
||
3785 |
positiveSign <String> |
|
3786 |
||
3787 |
negativeSign <String> |
|
3788 |
||
3789 |
internationalFractionalDigits <Integer> |
|
3790 |
||
3791 |
fractionalDigits <Integer> |
|
3792 |
||
3793 |
positiveSignPrecedesCurrencySymbol <Boolean> |
|
3794 |
||
3795 |
negativeSignPrecedesCurrencySymbol <Boolean> |
|
3796 |
||
3797 |
positiveSignSeparatedBySpaceFromCurrencySymbol <Boolean> |
|
3798 |
||
3799 |
negativeSignSeparatedBySpaceFromCurrencySymbol <Boolean> |
|
3800 |
||
3801 |
positiveSignPosition <Symbol> |
|
3802 |
one of: #parenthesesAround, |
|
3803 |
#signPrecedes, |
|
3804 |
#signSuceeds, |
|
3805 |
#signPrecedesCurrencySymbol, |
|
3806 |
#signSuceedsCurrencySymbol |
|
3807 |
||
3808 |
negativeSignPosition <like above> |
|
3576
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 |
it is up to the application to deal with undefined values. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3811 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3812 |
Notice, that (for now), the system does not use this information; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3813 |
it should be used by applications as required. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3814 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3815 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3816 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3817 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3818 |
|
15509
66c4c1bfa0aa
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15491
diff
changeset
|
3819 |
getNetworkAddressInfo |
16499 | 3820 |
"return a Dictionary of network interface information. |
3821 |
key -> name of interface |
|
3822 |
value -> a Set of network address |
|
3823 |
information for the interface - a dictionaries containing the |
|
3824 |
information about the configuration of each interface in the system. |
|
3825 |
The dictionary keys are: |
|
3826 |
#address |
|
3827 |
#netmask |
|
3828 |
#flags |
|
3829 |
#destAddress" |
|
15509
66c4c1bfa0aa
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15491
diff
changeset
|
3830 |
|
66c4c1bfa0aa
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15491
diff
changeset
|
3831 |
^ self subclassResponsibility |
66c4c1bfa0aa
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15491
diff
changeset
|
3832 |
! |
66c4c1bfa0aa
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15491
diff
changeset
|
3833 |
|
8997 | 3834 |
getNetworkAddresses |
3835 |
"return a dictionary with key:name of interface and |
|
13891 | 3836 |
value:the network address for each interface" |
8997 | 3837 |
|
3838 |
self subclassResponsibility |
|
3839 |
! |
|
3840 |
||
7289
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3841 |
getNetworkMACAddresses |
8669 | 3842 |
"return a dictionary with key:name of interface and |
13891 | 3843 |
value:the MAC adress for each interface" |
6363 | 3844 |
|
3845 |
self subclassResponsibility |
|
3846 |
! |
|
3847 |
||
7289
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3848 |
getNetworkMACAddressesForIf:ifName |
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3849 |
"return the MAC adress for interface ifName" |
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3850 |
|
15762
ebeb36b19b54
class: AbstractOperatingSystem
Michael Beyl <mb@exept.de>
parents:
15520
diff
changeset
|
3851 |
^ self getNetworkMACAddresses at:ifName ifAbsent:nil |
8641
1b45626f0e50
noMacAddress fallBack (NT4.0)
Claus Gittinger <cg@exept.de>
parents:
8587
diff
changeset
|
3852 |
|
1b45626f0e50
noMacAddress fallBack (NT4.0)
Claus Gittinger <cg@exept.de>
parents:
8587
diff
changeset
|
3853 |
"Modified: / 17-11-2004 / 01:43:35 / cg" |
6363 | 3854 |
! |
3855 |
||
10684 | 3856 |
getNumberOfProcessors |
12642
fb3cd8883f7e
remove unused and unimplemented subclass responsibility methods.
Stefan Vogel <sv@exept.de>
parents:
12639
diff
changeset
|
3857 |
"answer the number of physical processors in the system" |
fb3cd8883f7e
remove unused and unimplemented subclass responsibility methods.
Stefan Vogel <sv@exept.de>
parents:
12639
diff
changeset
|
3858 |
|
10684 | 3859 |
self subclassResponsibility |
3860 |
! |
|
3861 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3862 |
getOSDefine |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3863 |
"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
|
3864 |
compiled, and which should be passed down when compiling methods. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3865 |
For example, on linux, this is '-DLINUX'." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3866 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3867 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3868 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3869 |
#ifndef OS_DEFINE |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3870 |
# ifdef WIN32 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3871 |
# define OS_DEFINE "-DWIN32" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3872 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3873 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3874 |
# ifndef OS_DEFINE |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3875 |
# define OS_DEFINE "-DunknownOS" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3876 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3877 |
#endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3878 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3879 |
RETURN ( __MKSTRING(OS_DEFINE)); |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3880 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3881 |
#undef OS_DEFINE |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3882 |
%} |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3883 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3884 |
OperatingSystem getOSDefine |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3885 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3886 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3887 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3888 |
getOSType |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3889 |
"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
|
3890 |
This can be used to adapt programs to certain environment |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3891 |
differences (for example: mail-lock strategy ...)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3892 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3893 |
|os| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3894 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3895 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3896 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3897 |
# ifdef MSDOS |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3898 |
# define OS_SYMBOL @symbol(msdos) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3899 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3900 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3901 |
# ifdef WIN32 |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3902 |
# define OS_SYMBOL @symbol(win32) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3903 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3904 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3905 |
# ifdef MSWINDOWS |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3906 |
# define OS_SYMBOL @symbol(mswindows) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3907 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3908 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3909 |
# ifdef VMS |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3910 |
# ifdef __openVMS__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3911 |
# define OS_SYMBOL @symbol(openVMS) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3912 |
# else |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3913 |
# define OS_SYMBOL @symbol(VMS) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3914 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3915 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3916 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3917 |
# ifdef MVS /* ;-) */ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3918 |
# define OS_SYMBOL @symbol(mvs) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3919 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3920 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3921 |
# ifdef OS2 |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3922 |
# define OS_SYMBOL @symbol(os2) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3923 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3924 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3925 |
# ifdef sinix |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3926 |
# define OS_SYMBOL @symbol(sinix) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3927 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3928 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3929 |
# ifdef ultrix |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3930 |
# define OS_SYMBOL @symbol(ultrix) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3931 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3932 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3933 |
# ifdef sco |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3934 |
# define OS_SYMBOL @symbol(sco) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3935 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3936 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3937 |
# ifdef hpux |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3938 |
# define OS_SYMBOL @symbol(hpux) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3939 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3940 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3941 |
# ifdef LINUX |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3942 |
# define OS_SYMBOL @symbol(linux) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3943 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3944 |
|
6651 | 3945 |
# ifdef FREEBSD |
3946 |
# define OS_SYMBOL @symbol(freeBSD) |
|
3947 |
# endif |
|
3948 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3949 |
# ifdef sunos |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3950 |
# define OS_SYMBOL @symbol(sunos) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3951 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3952 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3953 |
# ifdef solaris |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3954 |
# define OS_SYMBOL @symbol(solaris) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3955 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3956 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3957 |
# ifdef IRIS |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3958 |
# define OS_SYMBOL @symbol(irix) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3959 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3960 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3961 |
# ifdef aix |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3962 |
# define OS_SYMBOL @symbol(aix) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3963 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3964 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3965 |
# ifdef realIX |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3966 |
# define OS_SYMBOL @symbol(realIX) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3967 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3968 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3969 |
# ifdef __osf__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3970 |
# define OS_SYMBOL @symbol(osf) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3971 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3972 |
|
14657 | 3973 |
# ifdef __osx__ |
3974 |
# define OS_SYMBOL @symbol(osx) |
|
3975 |
# endif |
|
3976 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3977 |
/* |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3978 |
* no concrete info; become somewhat vague ... |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3979 |
*/ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3980 |
# ifndef OS_SYMBOL |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3981 |
# ifdef MACH |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3982 |
# define OS_SYMBOL @symbol(mach) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3983 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3984 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3985 |
|
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3986 |
# ifndef OS_SYMBOL |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3987 |
# ifdef BSD |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3988 |
# define OS_SYMBOL @symbol(bsd) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3989 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3990 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3991 |
# ifdef SYSV |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3992 |
# ifdef SYSV3 |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3993 |
# define OS_SYMBOL @symbol(sys5_3) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3994 |
# else |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3995 |
# ifdef SYSV4 |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3996 |
# define OS_SYMBOL @symbol(sys5_4) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3997 |
# else |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3998 |
# define OS_SYMBOL @symbol(sys5) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3999 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4000 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4001 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4002 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4003 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4004 |
/* |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4005 |
* become very vague ... |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4006 |
*/ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
4007 |
# ifndef OS_SYMBOL |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4008 |
# ifdef POSIX |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
4009 |
# define OS_SYMBOL @symbol(posix) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4010 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4011 |
# endif |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
4012 |
# ifndef OS_SYMBOL |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4013 |
# ifdef UNIX |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
4014 |
# define OS_SYMBOL @symbol(unix) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4015 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4016 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4017 |
|
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
4018 |
# ifndef OS_SYMBOL |
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
4019 |
# define OS_SYMBOL @symbol(unknown) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4020 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4021 |
|
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
4022 |
os = OS_SYMBOL; |
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
4023 |
|
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
4024 |
# undef OS_SYMBOL |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4025 |
%}. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4026 |
^ os |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4027 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4028 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4029 |
OperatingSystem getOSType |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4030 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4031 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4032 |
|
9698
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4033 |
getPlatformDefine |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4034 |
"return a string which defines the platform, |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4035 |
and which should be passed down when compiling methods. |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4036 |
For example, on all unices, this is '-DUNIX'." |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4037 |
|
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4038 |
%{ /* NOCONTEXT */ |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4039 |
|
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4040 |
#ifndef PLATFORM_DEFINE |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4041 |
# ifdef WIN32 |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4042 |
# define PLATFORM_DEFINE "-DWIN32" |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4043 |
# endif |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4044 |
# ifdef OS2 |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4045 |
# define PLATFORM_DEFINE "-DOS2" |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4046 |
# endif |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4047 |
# ifdef BEOS |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4048 |
# define PLATFORM_DEFINE "-DBEOS" |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4049 |
# endif |
9699 | 4050 |
# ifdef MACOS |
4051 |
# define PLATFORM_DEFINE "-DMACOS" |
|
4052 |
# endif |
|
4053 |
# ifdef VMS |
|
4054 |
# define PLATFORM_DEFINE "-DVMS" |
|
4055 |
# endif |
|
17637 | 4056 |
# ifdef __osx__ |
4057 |
# define PLATFORM_DEFINE "-D__osx__" |
|
4058 |
# endif |
|
16150
cf9e37fcb3bd
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
15914
diff
changeset
|
4059 |
# ifdef OSX |
cf9e37fcb3bd
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
15914
diff
changeset
|
4060 |
# define PLATFORM_DEFINE "-DOSX" |
cf9e37fcb3bd
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
15914
diff
changeset
|
4061 |
# endif |
9698
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4062 |
# ifndef PLATFORM_DEFINE |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4063 |
# define PLATFORM_DEFINE "-DUNIX" |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4064 |
# endif |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4065 |
#endif |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4066 |
|
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4067 |
RETURN ( __MKSTRING(PLATFORM_DEFINE)); |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4068 |
%} |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4069 |
" |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4070 |
OperatingSystem getPlatformDefine |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4071 |
" |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4072 |
! |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4073 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4074 |
getProcessId |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4075 |
"return the (unix-)processId" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4076 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4077 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4078 |
! |
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 |
getSystemID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4081 |
"if supported by the OS, return the systemID; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4082 |
a unique per machine identification. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4083 |
WARNING: |
13891 | 4084 |
not all systems support this; on some, 'unknown' is returned." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4085 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4086 |
^ 'unknown' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4087 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4088 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4089 |
OperatingSystem getSystemID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4090 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4091 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4092 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4093 |
getSystemInfo |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4094 |
"return info on the system weare running on. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4095 |
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
|
4096 |
otherwise, some simulated info is returned. |
8669 | 4097 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4098 |
WARNING: |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4099 |
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
|
4100 |
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
|
4101 |
OS, for example, linux returns 'ix86', while WIN32 returns 'x86'. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4102 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4103 |
This method is mainly provided to augment error reports with some system |
8669 | 4104 |
information. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4105 |
(in case of system/version specific OS errors, conditional workarounds and patches |
13891 | 4106 |
may be based upon this info). |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4107 |
Your application should NOT depend upon this in any way. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4108 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4109 |
The returned info may (or may not) contain: |
13891 | 4110 |
#system -> some operating system identification (irix, Linux, nt, win32s ...) |
4111 |
#version -> OS version (some os version identification) |
|
4112 |
#release -> OS release (3.5, 1.2.1 ...) |
|
4113 |
#node -> some host identification (hostname) |
|
4114 |
#domain -> domain name (hosts domain) |
|
4115 |
#machine -> type of machine (i586, mips ...) |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4116 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4117 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4118 |
|info| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4119 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4120 |
info := IdentityDictionary new. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4121 |
info at:#system put:(self getSystemType). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4122 |
info at:#node put:(self getHostName). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4123 |
info at:#machine put:(self getCPUType). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4124 |
info at:#architecture put:'unknown'. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4125 |
info at:#domain put:self getDomainName. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4126 |
info at:#osType put:(self getOSType). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4127 |
^ info |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4128 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4129 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4130 |
OperatingSystem getSystemInfo |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4131 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4132 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4133 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4134 |
getSystemType |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4135 |
"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
|
4136 |
This is almost the same as getOSType, but the returned string |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4137 |
is slightly different for some systems (i.e. iris vs. irix). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4138 |
Dont depend on this - use getOSType. I dont really see a point |
8669 | 4139 |
here ... |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4140 |
(except for slight differences between next/mach and other machs)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4141 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4142 |
^ self getOSType |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4143 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4144 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4145 |
OperatingSystem getSystemType |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4146 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4147 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4148 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4149 |
getWindowsDirectory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4150 |
"internal interface - only for Windows based systems. |
9699 | 4151 |
Return the windows directory, which, depending on the system, |
4152 |
may be |
|
13891 | 4153 |
'\WINNT', '\WINDOWS' |
9699 | 4154 |
or whatever. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4155 |
On non-windows systems, nil is returned." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4156 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4157 |
^ nil |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4158 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4159 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4160 |
OperatingSystem getWindowsDirectory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4161 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4162 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4163 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4164 |
getWindowsSystemDirectory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4165 |
"internal interface - only for Windows based systems. |
9699 | 4166 |
Return the windows system directory, which, depending on the system, |
13891 | 4167 |
may be |
4168 |
'\WINNT\SYSTEM32', '\WINDOWS\SYSTEM' |
|
9699 | 4169 |
or whatever. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4170 |
On non-windows systems, nil is returned." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4171 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4172 |
^ nil |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4173 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4174 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4175 |
OperatingSystem getWindowsSystemDirectory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4176 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4177 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4178 |
|
4207 | 4179 |
hasConsole |
4180 |
"return true, if there is some kind of console available |
|
4181 |
(i.e. for proper stdIn, stdOut and stdErr handling). |
|
5918 | 4182 |
This only returns false when running under windows, and |
4207 | 4183 |
the system is running as a pure windows application. |
4184 |
If false, the miniDebugger is useless and not used." |
|
4185 |
||
4186 |
^ true |
|
4187 |
! |
|
4188 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4189 |
isBSDlike |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4190 |
"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
|
4191 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4192 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4193 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4194 |
|
17580
e7f4e453fa96
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17531
diff
changeset
|
4195 |
isLinuxLike |
e7f4e453fa96
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17531
diff
changeset
|
4196 |
"return true, if the OS we're running on is a linux." |
17637 | 4197 |
|
17580
e7f4e453fa96
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17531
diff
changeset
|
4198 |
^ false |
e7f4e453fa96
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17531
diff
changeset
|
4199 |
! |
e7f4e453fa96
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17531
diff
changeset
|
4200 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4201 |
isMAClike |
9699 | 4202 |
"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
|
4203 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4204 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4205 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4206 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4207 |
isMSDOSlike |
9699 | 4208 |
"return true, if the OS we're running on is msdos like (in contrast to unix-like). |
4209 |
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
|
4210 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4211 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4212 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4213 |
|
3901 | 4214 |
isMSWINDOWSNTlike |
4215 |
"This returns true if running in a Windows-NT system." |
|
4216 |
||
4217 |
^ false. |
|
4218 |
! |
|
4219 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4220 |
isMSWINDOWSlike |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4221 |
"return true, if running on a MS-Windows like system. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4222 |
This returns true for any of win32s, win95 and winNT." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4223 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4224 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4225 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4226 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4227 |
isOS2like |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4228 |
"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
|
4229 |
Only returns true for a plain OS/2 system." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4230 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4231 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4232 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4233 |
|
14800
1b698862772e
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14757
diff
changeset
|
4234 |
isOSXlike |
14801
b70fa510595f
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14800
diff
changeset
|
4235 |
"return true, if the OS we're running on is a mac OSX like (but not A/UX or OS9)." |
14800
1b698862772e
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14757
diff
changeset
|
4236 |
|
1b698862772e
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14757
diff
changeset
|
4237 |
^ false |
1b698862772e
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14757
diff
changeset
|
4238 |
! |
1b698862772e
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14757
diff
changeset
|
4239 |
|
12639 | 4240 |
isProcessIdPresent:pid |
4241 |
"answer true, if a process with process id pid is present, false if not. |
|
4242 |
Raise an error, if an exception occures" |
|
4243 |
||
4244 |
^ self subclassResponsibility |
|
4245 |
! |
|
4246 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4247 |
isUNIXlike |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4248 |
"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
|
4249 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4250 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4251 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4252 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4253 |
isVMSlike |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4254 |
"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
|
4255 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4256 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4257 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4258 |
|
9697 | 4259 |
knownPlatformNames |
4260 |
"return a collection of strings as possibly returned by getPlatformName. |
|
4261 |
Should be used instead of getOSType or getSystemType if multiple choice |
|
4262 |
dialogs are presented to the user." |
|
4263 |
||
4264 |
^#( |
|
16499 | 4265 |
win32 |
4266 |
os2 "/ actually - this is no longer true (OS/2 not supported) |
|
4267 |
macos "/ actually - this is no longer true (old MACOS not supported) |
|
4268 |
vms "/ actually - this is no longer true (VMS not supported) |
|
4269 |
beos "/ actually - this was never true (beos not supported) |
|
4270 |
osx "/ yes!! it is supported |
|
4271 |
unix |
|
9697 | 4272 |
) |
4273 |
||
4274 |
" |
|
4275 |
OperatingSystem knownPlatformNames |
|
4276 |
OperatingSystem platformName |
|
9698
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
4277 |
OperatingSystem getPlatformDefine |
9697 | 4278 |
" |
4279 |
||
4280 |
"Modified: 20.6.1997 / 17:37:26 / cg" |
|
4281 |
! |
|
4282 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4283 |
maxFileNameLength |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4284 |
"return the max number of characters in a filename. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4285 |
CAVEAT: |
13891 | 4286 |
Actually, the following is somewhat wrong - some systems |
4287 |
support different sizes, depending on the volume. |
|
4288 |
We return a somewhat conservative number here. |
|
4289 |
Another entry, to query for volume specific max |
|
4290 |
will be added in the future." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4291 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4292 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4293 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4294 |
|
6578 | 4295 |
maxNumberOfOpenFiles |
4296 |
"answer the maximum number of open files for this process" |
|
4297 |
||
4298 |
^ self subclassResponsibility |
|
4299 |
! |
|
4300 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4301 |
maxPathLength |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4302 |
"return the max number of characters in a pathName." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4303 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4304 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4305 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4306 |
|
13557 | 4307 |
osName |
4308 |
"return a string describing the OS platform very we're running on. |
|
4309 |
This returns #unix for all unix derivatives. |
|
4310 |
I.e. it is much less specific than getOSType or getSystemType." |
|
4311 |
||
4312 |
|info| |
|
4313 |
||
4314 |
info := self getSystemInfo. |
|
4315 |
^ ((info at:#system) ? '?') |
|
4316 |
, |
|
4317 |
((info at:#version) ? '?') |
|
4318 |
||
4319 |
" |
|
4320 |
OperatingSystem getSystemInfo |
|
4321 |
OperatingSystem osName |
|
4322 |
" |
|
4323 |
||
4324 |
"Modified: / 20-06-1997 / 17:37:26 / cg" |
|
4325 |
"Created: / 05-08-2011 / 18:18:53 / cg" |
|
4326 |
! |
|
4327 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4328 |
pathSeparator |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4329 |
"return the character which separates items in the PATH variable" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4330 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4331 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4332 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4333 |
|
9700 | 4334 |
platformDefineForPlatformName:osID |
9699 | 4335 |
"return a c-define for a particular platform (use only for makefile generation etc.)" |
4336 |
||
12543
0ccfdbd164d6
changed: #platformDefineForPlatformName:
Stefan Vogel <sv@exept.de>
parents:
11846
diff
changeset
|
4337 |
osID = #win32 ifTrue:[ ^ '-DWIN32']. |
0ccfdbd164d6
changed: #platformDefineForPlatformName:
Stefan Vogel <sv@exept.de>
parents:
11846
diff
changeset
|
4338 |
osID = #os2 ifTrue:[ ^ '-DOS2']. |
0ccfdbd164d6
changed: #platformDefineForPlatformName:
Stefan Vogel <sv@exept.de>
parents:
11846
diff
changeset
|
4339 |
osID = #macos ifTrue:[ ^ '-DMACOS']. |
0ccfdbd164d6
changed: #platformDefineForPlatformName:
Stefan Vogel <sv@exept.de>
parents:
11846
diff
changeset
|
4340 |
osID = #beos ifTrue:[ ^ '-DBEOS']. |
0ccfdbd164d6
changed: #platformDefineForPlatformName:
Stefan Vogel <sv@exept.de>
parents:
11846
diff
changeset
|
4341 |
osID = #vms ifTrue:[ ^ '-DVMS']. |
0ccfdbd164d6
changed: #platformDefineForPlatformName:
Stefan Vogel <sv@exept.de>
parents:
11846
diff
changeset
|
4342 |
osID = #unix ifTrue:[ ^ '-DUNIX']. |
17638 | 4343 |
osID = #osx ifTrue:[ ^ '-DOSX']. |
9699 | 4344 |
self error:'unknown os'. |
4345 |
||
4346 |
" |
|
4347 |
OperatingSystem platformDefineForName:(OperatingSystem platformName) |
|
4348 |
" |
|
4349 |
||
4350 |
"Modified: 20.6.1997 / 17:37:26 / cg" |
|
4351 |
! |
|
4352 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4353 |
platformName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4354 |
"return a string describing the OS platform very we're running on. |
17638 | 4355 |
Except for osx, this returns #unix for all other unix derivatives. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4356 |
I.e. it is much less specific than getOSType or getSystemType." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4357 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4358 |
|os| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4359 |
|
16499 | 4360 |
os := self getSystemType. |
11170
ced52c04b215
#platformName - answer symbols
Stefan Vogel <sv@exept.de>
parents:
11166
diff
changeset
|
4361 |
os = #win32 ifTrue:[ ^ #win32]. |
ced52c04b215
#platformName - answer symbols
Stefan Vogel <sv@exept.de>
parents:
11166
diff
changeset
|
4362 |
os = #os2 ifTrue:[ ^ #os2]. |
16150
cf9e37fcb3bd
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
15914
diff
changeset
|
4363 |
os = #osx ifTrue:[ ^ #osx]. |
11170
ced52c04b215
#platformName - answer symbols
Stefan Vogel <sv@exept.de>
parents:
11166
diff
changeset
|
4364 |
os = #macos ifTrue:[ ^ #macos]. |
ced52c04b215
#platformName - answer symbols
Stefan Vogel <sv@exept.de>
parents:
11166
diff
changeset
|
4365 |
os = #VMS ifTrue:[ ^ #vms]. |
ced52c04b215
#platformName - answer symbols
Stefan Vogel <sv@exept.de>
parents:
11166
diff
changeset
|
4366 |
os = #openVMS ifTrue:[ ^ #vms]. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4367 |
^ #unix |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4368 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4369 |
" |
9697 | 4370 |
OperatingSystem knownPlatformNames |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4371 |
OperatingSystem platformName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4372 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4373 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4374 |
"Modified: 20.6.1997 / 17:37:26 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4375 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4376 |
|
13891 | 4377 |
randomBytesInto:bufferOrInteger |
12826 | 4378 |
"If bufferOrInteger is a String or a ByteArray, |
16948 | 4379 |
fill a given buffer with random bytes from the RtlGenRandom function |
4380 |
and answer the buffer. |
|
12826 | 4381 |
|
4382 |
If bufferOrInteger is a SmallInteger, |
|
16948 | 4383 |
return this many bytes (max 4) as a SmallInteger. |
13891 | 4384 |
|
4385 |
Return nil on error (may raise PrimitiveFailure, too). |
|
12826 | 4386 |
|
4387 |
NOTE: This is a private interface, please use RandomGenerator!! |
|
12824 | 4388 |
|
4389 |
Subclasses should implement this, if the OperatingSystem supports a random generator." |
|
4390 |
||
13891 | 4391 |
^ nil "not implemented" |
12824 | 4392 |
! |
4393 |
||
12604 | 4394 |
setEnvironment:aStringOrSymbol to:newValueString |
4395 |
"set an environment variable" |
|
4396 |
||
4397 |
^ self subclassResponsibility |
|
4398 |
! |
|
4399 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4400 |
setLocaleInfo:anInfoDictionary |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4401 |
"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
|
4402 |
(internal in ST/X only - the OS's settings remain unaffected) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4403 |
See description of fields in #getLocaleInfo. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4404 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4405 |
Notice, that (for now), the system does not use this information; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4406 |
it should be used by applications as required." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4407 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4408 |
LocaleInfo := anInfoDictionary |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4409 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4410 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4411 |
|d| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4412 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4413 |
d := IdentityDictionary new. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4414 |
d at:#decimalPoint put:'.' . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4415 |
d at:#thousandsSeparator put:',' . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4416 |
d at:#currencySymbol put:'USD' . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4417 |
d at:#monetaryDecimalPoint put:'.' . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4418 |
d at:#monetaryThousandsSeparator put:'.' . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4419 |
d at:#fractionalDigits put:2 . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4420 |
d at:#positiveSign put:'+' . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4421 |
d at:#negativeSign put:'-' . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4422 |
d at:#positiveSignPrecedesCurrencySymbol put:true . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4423 |
d at:#negativeSignPrecedesCurrencySymbol put:false . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4424 |
OperatingSystem setLocaleInfo:d |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4425 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4426 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4427 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4428 |
supportsChildInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4429 |
"return true, if the OS supports childProcess termination signalling |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4430 |
through interrupts (i.e. SIGCHILD)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4431 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4432 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4433 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4434 |
" |
8669 | 4435 |
OperatingSystem supportsChildInterrupts |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4436 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4437 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4438 |
|
3826 | 4439 |
supportsFileOwnerGroups |
4440 |
"return true, if the OS's file system supports file |
|
4441 |
group ownership - here, we are optimistic assuming that |
|
4442 |
we are running under a real OS. |
|
4443 |
Redefined in Win32OS to return false." |
|
4444 |
||
4445 |
^ true |
|
4446 |
||
4447 |
"Modified: / 10.9.1998 / 17:48:20 / cg" |
|
4448 |
"Created: / 10.9.1998 / 17:56:28 / cg" |
|
4449 |
! |
|
4450 |
||
4451 |
supportsFileOwners |
|
4452 |
"return true, if the OS's file system supports file |
|
4453 |
ownership - here, we are optimistic assuming that |
|
4454 |
we are running under a real OS. |
|
4455 |
Redefined in Win32OS to return false." |
|
4456 |
||
4457 |
^ true |
|
4458 |
||
4459 |
"Modified: / 10.9.1998 / 17:48:20 / cg" |
|
4460 |
"Created: / 10.9.1998 / 17:56:11 / cg" |
|
4461 |
! |
|
4462 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4463 |
supportsIOInterrupts |
8669 | 4464 |
"return true, if the OS supports IO availability interrupts |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4465 |
(i.e. SIGPOLL/SIGIO)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4466 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4467 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4468 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4469 |
" |
8669 | 4470 |
OperatingSystem supportsIOInterrupts |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4471 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4472 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4473 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4474 |
supportsNonBlockingIO |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4475 |
"return true, if the OS supports nonblocking IO." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4476 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4477 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4478 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4479 |
" |
8669 | 4480 |
OperatingSystem supportsNonBlockingIO |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4481 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4482 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4483 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4484 |
supportsSelect |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4485 |
"return true, if the OS supports selecting on multiple |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4486 |
filedescriptors via select. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4487 |
If false is returned, ProcessorScheduler will poll in 50ms |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4488 |
intervals for I/O becoming ready." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4489 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4490 |
^ true |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4491 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4492 |
" |
8669 | 4493 |
OperatingSystem supportsSelect |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4494 |
" |
3901 | 4495 |
! |
4496 |
||
5099 | 4497 |
supportsSelectOnPipes |
4498 |
"return true, if the OS supports selecting on pipe |
|
4499 |
filedescriptors via select. |
|
4500 |
If false is returned, ProcessorScheduler will poll in 50ms |
|
4501 |
intervals for I/O becoming ready." |
|
4502 |
||
4503 |
^ true |
|
4504 |
||
4505 |
" |
|
8669 | 4506 |
OperatingSystem supportsSelectOnPipes |
5099 | 4507 |
" |
4508 |
||
4509 |
"Modified: / 14.12.1999 / 19:40:32 / cg" |
|
4510 |
"Created: / 14.12.1999 / 19:43:43 / cg" |
|
4511 |
! |
|
4512 |
||
4513 |
supportsSelectOnSockets |
|
4514 |
"return true, if the OS supports selecting on socket |
|
4515 |
filedescriptors via select. |
|
4516 |
If false is returned, ProcessorScheduler will poll in 50ms |
|
4517 |
intervals for I/O becoming ready." |
|
4518 |
||
4519 |
^ true |
|
4520 |
||
4521 |
" |
|
8669 | 4522 |
OperatingSystem supportsSelectOnSockets |
5099 | 4523 |
" |
4524 |
||
4525 |
"Modified: / 14.12.1999 / 19:40:32 / cg" |
|
4526 |
! |
|
4527 |
||
3901 | 4528 |
supportsVolumes |
4529 |
"return true, if the OS supports disk volumes. |
|
17178
623ad6fc9dca
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17170
diff
changeset
|
4530 |
False is returned for UNIX, true for MSDOS, VMS and OSX (which treats /Volumes as such)" |
3901 | 4531 |
|
4532 |
^ false |
|
4533 |
||
4534 |
"Created: / 29.10.1998 / 13:20:37 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4535 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4536 |
|
4146 | 4537 |
!AbstractOperatingSystem class methodsFor:'path queries'! |
4538 |
||
16395
6f0be1e7811f
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16380
diff
changeset
|
4539 |
decodePath:encodedPathNameOrOutputLine |
6f0be1e7811f
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16380
diff
changeset
|
4540 |
"decode the encodedPathNameOrOutputLine as returned by system calls or output by system commands. |
6f0be1e7811f
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16380
diff
changeset
|
4541 |
E.g. linux system calls return single byte strings only, |
6f0be1e7811f
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16380
diff
changeset
|
4542 |
so pathNames have been UTF-8 encoded." |
6f0be1e7811f
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16380
diff
changeset
|
4543 |
|
16416
682545b16b48
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16412
diff
changeset
|
4544 |
^ self decodePathOrCommandOutput:encodedPathNameOrOutputLine |
682545b16b48
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16412
diff
changeset
|
4545 |
! |
682545b16b48
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16412
diff
changeset
|
4546 |
|
682545b16b48
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16412
diff
changeset
|
4547 |
decodePathOrCommandOutput:encodedPathNameOrOutputLine |
682545b16b48
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16412
diff
changeset
|
4548 |
"decode the encodedPathNameOrOutputLine as returned by system calls or output by system commands. |
682545b16b48
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16412
diff
changeset
|
4549 |
E.g. linux system calls return single byte strings only, |
682545b16b48
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16412
diff
changeset
|
4550 |
so pathNames have been UTF-8 encoded." |
682545b16b48
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16412
diff
changeset
|
4551 |
|
16395
6f0be1e7811f
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16380
diff
changeset
|
4552 |
^ encodedPathNameOrOutputLine |
14565
ddebb49ea73c
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
13970
diff
changeset
|
4553 |
! |
ddebb49ea73c
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
13970
diff
changeset
|
4554 |
|
5143 | 4555 |
defaultPackagePath |
16643
4775f776440c
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16576
diff
changeset
|
4556 |
"return a default packagePath - that's a collection of |
5143 | 4557 |
dirnames, where ST/X searches for its package subdirs. |
5159
ca0524ab2576
defaultPackagePath initialization fixed
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
4558 |
This method might be redefined in concrete OS's to add |
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4559 |
OS-specific directory names." |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4560 |
|
16166 | 4561 |
|packagePath execPath dirName homeDirName priv userPrivateSTXDir appDir topDirName| |
5143 | 4562 |
|
4563 |
" |
|
4564 |
the path is set to search files first locally |
|
4565 |
- this allows private stuff to override global stuff |
|
4566 |
" |
|
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4567 |
packagePath := OrderedCollection new. |
5143 | 4568 |
|
4569 |
"/ |
|
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4570 |
"/ the current (default) directory: |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4571 |
"/ ./packages |
5143 | 4572 |
"/ |
13117
67e3821b67f1
changed: #defaultPackagePath
Claus Gittinger <cg@exept.de>
parents:
13115
diff
changeset
|
4573 |
packagePath add:('.' "Filename currentDirectory pathName"). |
5143 | 4574 |
|
16166 | 4575 |
"/ accept the fact that sometimes, we cannot figure out, where I im |
4576 |
execPath := self pathOfSTXExecutable. |
|
4577 |
execPath notNil ifTrue:[ |
|
16948 | 4578 |
"/ |
4579 |
"/ the executable's directory: |
|
4580 |
"/ (/opt/stx/bin/stx -> /opt/stx/bin) |
|
4581 |
"/ |
|
4582 |
appDir := execPath asFilename directory. |
|
4583 |
(packagePath includes:appDir) ifFalse:[ |
|
4584 |
packagePath add:appDir. |
|
4585 |
]. |
|
4586 |
||
4587 |
"/ |
|
4588 |
"/ the executable's parent directory: |
|
4589 |
"/ (/opt/stx/bin/stx -> /opt/stx) |
|
4590 |
"/ |
|
4591 |
appDir := appDir directory. |
|
4592 |
dirName := appDir pathName. |
|
4593 |
(packagePath includes:dirName) ifFalse:[ |
|
4594 |
packagePath add:dirName. |
|
4595 |
]. |
|
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4596 |
]. |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4597 |
|
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4598 |
homeDirName := OperatingSystem getHomeDirectory. |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4599 |
homeDirName notNil ifTrue:[ |
16948 | 4600 |
"/ |
4601 |
"/ a users private smalltalk directory in its home (login) directory: |
|
4602 |
"/ $HOME/.smalltalk/packages or $HOME\smalltalk\packages |
|
4603 |
"/ |
|
4604 |
OperatingSystem isUNIXlike ifTrue:[ |
|
4605 |
priv := '.smalltalk'. |
|
4606 |
] ifFalse:[ |
|
4607 |
priv := 'smalltalk'. |
|
4608 |
]. |
|
4609 |
userPrivateSTXDir := homeDirName asFilename / priv. |
|
4610 |
(userPrivateSTXDir isDirectory) ifTrue:[ |
|
4611 |
dirName := userPrivateSTXDir pathName. |
|
4612 |
(packagePath includes:dirName) ifFalse:[ |
|
4613 |
packagePath add:dirName |
|
4614 |
] |
|
4615 |
]. |
|
8669 | 4616 |
]. |
5143 | 4617 |
|
4618 |
"/ |
|
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4619 |
"/ STX_TOPDIR from the environment: |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4620 |
"/ $STX_TOPDIR/packages |
5143 | 4621 |
"/ |
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4622 |
topDirName := OperatingSystem getEnvironment:'STX_TOPDIR'. |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4623 |
topDirName notNil ifTrue:[ |
16948 | 4624 |
(packagePath includes:topDirName) ifFalse:[ |
4625 |
packagePath add:topDirName |
|
4626 |
]. |
|
5143 | 4627 |
]. |
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4628 |
|
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4629 |
packagePath := packagePath select:[:each | (each asFilename / 'packages') exists] |
16948 | 4630 |
thenCollect:[:each | (each asFilename constructString:'packages')]. |
16643
4775f776440c
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16576
diff
changeset
|
4631 |
|
4775f776440c
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16576
diff
changeset
|
4632 |
" |
4775f776440c
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16576
diff
changeset
|
4633 |
unconditionally prepend all directories from $STX_PACKAGEPATH |
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4634 |
" |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4635 |
(dirName := OperatingSystem getEnvironment:'STX_PACKAGEPATH') notNil ifTrue:[ |
16948 | 4636 |
dirName := dirName asCollectionOfSubstringsSeparatedBy:$:. |
4637 |
dirName reverseDo:[:eachDirectoryName| |
|
4638 |
(packagePath includes:eachDirectoryName) ifFalse:[ |
|
4639 |
packagePath addFirst:eachDirectoryName. |
|
4640 |
]. |
|
4641 |
]. |
|
5654 | 4642 |
]. |
4643 |
||
16166 | 4644 |
false ifTrue:[ |
4645 |
appDir notNil ifTrue:[ |
|
16948 | 4646 |
"maybe the sources are kept in a central place..." |
4647 |
(appDir / 'source') isDirectory ifTrue:[ |
|
4648 |
packagePath add:(appDir / 'source') pathName. |
|
4649 |
]. |
|
13160 | 4650 |
]. |
16166 | 4651 |
]. |
13160 | 4652 |
|
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4653 |
"maybe we are running in the build environment: XXX/stx /projects /smalltalk |
16948 | 4654 |
or: XXX/exept /expecco /application |
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4655 |
- if XXX/stx/libbasic exists, add XXX to the package path" |
16166 | 4656 |
false ifTrue:[ |
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4657 |
topDirName isNil ifTrue:[ |
16948 | 4658 |
"appdir is now: projects" |
4659 |
appDir := appDir directory directory. |
|
4660 |
(appDir / 'stx' / 'libbasic') isDirectory ifTrue:[ |
|
4661 |
appDir pathName = homeDirName ifTrue:[ |
|
4662 |
"but take care, it may be directly in the home directory" |
|
4663 |
appDir := appDir / 'stx'. |
|
4664 |
]. |
|
4665 |
packagePath add:appDir pathName. |
|
4666 |
]. |
|
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4667 |
]. |
16166 | 4668 |
]. |
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4669 |
^ packagePath |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4670 |
|
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4671 |
" |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4672 |
OperatingSystem defaultPackagePath |
5143 | 4673 |
" |
4674 |
||
13281
54e7f034b1e8
changed: #defaultPackagePath
Claus Gittinger <cg@exept.de>
parents:
13228
diff
changeset
|
4675 |
"Modified: / 04-02-2011 / 16:27:15 / cg" |
5143 | 4676 |
! |
4677 |
||
4146 | 4678 |
defaultSystemPath |
16643
4775f776440c
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16576
diff
changeset
|
4679 |
"return a default systemPath - that's a collection of |
4146 | 4680 |
dirnames, where ST/X searches for its files. |
4681 |
This method is redefined in concrete OS's to add |
|
4682 |
OS-specific directory names." |
|
4683 |
||
12755
abeb561f4f70
changed: #defaultSystemPath
Claus Gittinger <cg@exept.de>
parents:
12642
diff
changeset
|
4684 |
|sysPath p appDir homePath priv userPrivateSTXDir appPath| |
4146 | 4685 |
|
4686 |
" |
|
4687 |
the path is set to search files first locally |
|
4688 |
- this allows private stuff to override global stuff |
|
4689 |
" |
|
4690 |
sysPath := OrderedCollection new. |
|
4691 |
||
4692 |
"/ |
|
4693 |
"/ the current (default) directory |
|
4694 |
"/ |
|
13115
c61ada06e871
changed: #defaultSystemPath
Claus Gittinger <cg@exept.de>
parents:
13111
diff
changeset
|
4695 |
sysPath add:('.' "Filename currentDirectory pathName"). |
4146 | 4696 |
|
4697 |
"/ |
|
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4698 |
"/ the executable's directory |
13155 | 4699 |
"/ and the executables parent directory (if it is an installed version) |
9021 | 4700 |
"/ |
12755
abeb561f4f70
changed: #defaultSystemPath
Claus Gittinger <cg@exept.de>
parents:
12642
diff
changeset
|
4701 |
appPath := self pathOfSTXExecutable. |
abeb561f4f70
changed: #defaultSystemPath
Claus Gittinger <cg@exept.de>
parents:
12642
diff
changeset
|
4702 |
appPath notNil ifTrue:[ |
16948 | 4703 |
appDir := appPath asFilename directory. |
4704 |
appPath := appDir pathName. |
|
4705 |
(sysPath includes:appPath) ifFalse:[ |
|
4706 |
sysPath add:appPath. |
|
4707 |
]. |
|
4708 |
appDir baseName = 'bin' ifTrue:[ |
|
4709 |
appPath := appDir directory pathName. |
|
4710 |
(sysPath includes:appPath) ifFalse:[ |
|
4711 |
sysPath add:appPath. |
|
4712 |
]. |
|
4713 |
]. |
|
9021 | 4714 |
]. |
4715 |
||
4716 |
"/ |
|
4146 | 4717 |
"/ the users home (login) directory |
4718 |
"/ |
|
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4719 |
homePath := self getHomeDirectory. |
4146 | 4720 |
homePath notNil ifTrue:[ |
16948 | 4721 |
"/ |
4722 |
"/ a users private smalltalk directory in its home (login) directory |
|
4723 |
"/ |
|
4724 |
OperatingSystem isUNIXlike ifTrue:[ |
|
4725 |
priv := '.smalltalk'. |
|
4726 |
] ifFalse:[ |
|
4727 |
priv := 'smalltalk'. |
|
4728 |
]. |
|
4729 |
userPrivateSTXDir := homePath asFilename construct:priv. |
|
4730 |
(userPrivateSTXDir isDirectory) ifTrue:[ |
|
4731 |
userPrivateSTXDir := userPrivateSTXDir pathName. |
|
4732 |
(sysPath includes:userPrivateSTXDir) ifFalse:[ |
|
4733 |
sysPath add:userPrivateSTXDir |
|
4734 |
] |
|
4735 |
]. |
|
4146 | 4736 |
]. |
4737 |
||
4738 |
"/ |
|
5036 | 4739 |
"/ SMALLTALK_LIBDIR, STX_LIBDIR and STX_TOPDIR from the environment |
4146 | 4740 |
"/ |
13891 | 4741 |
#( |
16948 | 4742 |
'SMALLTALK_LIBDIR' |
4743 |
'STX_LIBDIR' |
|
4744 |
'STX_TOPDIR' |
|
5646
5dfccce8e880
no longer automatically add the home-dir to the systemPath
Claus Gittinger <cg@exept.de>
parents:
5486
diff
changeset
|
4745 |
) do:[:each | |
16948 | 4746 |
p := OperatingSystem decodePath:(OperatingSystem getEnvironment:each). |
4747 |
p notNil ifTrue:[ |
|
4748 |
p := p asFilename pathName. |
|
4749 |
(p asFilename isDirectory) ifTrue:[ |
|
4750 |
(sysPath includes:p) ifFalse:[ |
|
4751 |
sysPath add:p |
|
4752 |
] |
|
4753 |
] |
|
4754 |
]. |
|
5036 | 4755 |
]. |
4146 | 4756 |
^ sysPath |
5148 | 4757 |
|
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4758 |
" |
16948 | 4759 |
OperatingSystem defaultSystemPath |
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4760 |
" |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4761 |
|
5148 | 4762 |
"Modified: / 24.12.1999 / 00:30:27 / cg" |
14565
ddebb49ea73c
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
13970
diff
changeset
|
4763 |
! |
ddebb49ea73c
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
13970
diff
changeset
|
4764 |
|
14657 | 4765 |
encodePath:pathName |
14565
ddebb49ea73c
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
13970
diff
changeset
|
4766 |
"encode the pathName for use with system calls. |
14838
11f655b8f0f5
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
14831
diff
changeset
|
4767 |
E.g. linux system calls accept single byte strings only, |
14565
ddebb49ea73c
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
13970
diff
changeset
|
4768 |
so the pathName has been UTF-8 encoded, before using it in a system call." |
14657 | 4769 |
|
14565
ddebb49ea73c
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
13970
diff
changeset
|
4770 |
^ pathName |
4146 | 4771 |
! ! |
4772 |
||
9476 | 4773 |
!AbstractOperatingSystem class methodsFor:'printing support'! |
4774 |
||
4775 |
getPrinters |
|
4776 |
"return a collection of PrinterInfos" |
|
4777 |
||
4778 |
self subclassResponsibility |
|
4779 |
||
4780 |
"Created: / 27-07-2006 / 12:17:31 / fm" |
|
4781 |
! ! |
|
4782 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4783 |
!AbstractOperatingSystem class methodsFor:'private'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4784 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4785 |
osProcessStatusClass |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4786 |
^ self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4787 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4788 |
"Created: / 12.6.1998 / 16:30:29 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4789 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4790 |
|
7656 | 4791 |
!AbstractOperatingSystem class methodsFor:'queries-sockets'! |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4792 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4793 |
domainCodeOf:aSymbolOrInteger |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4794 |
"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
|
4795 |
Return nil for invalid or unsupported domains. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4796 |
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
|
4797 |
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
|
4798 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4799 |
|domainCode| |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4800 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4801 |
%{ /*NOCONTEXT*/ |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4802 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4803 |
if (__isSmallInteger(aSymbolOrInteger) || aSymbolOrInteger == nil) { |
13891 | 4804 |
RETURN (aSymbolOrInteger); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4805 |
} |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4806 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4807 |
#ifdef AF_INET |
8669 | 4808 |
else if ((aSymbolOrInteger == @symbol(AF_INET)) || (aSymbolOrInteger == @symbol(inet))) |
8913 | 4809 |
domainCode = __mkSmallInteger(AF_INET); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4810 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4811 |
#ifdef AF_INET6 |
8669 | 4812 |
else if ((aSymbolOrInteger == @symbol(AF_INET6)) || (aSymbolOrInteger == @symbol(inet6))) |
8913 | 4813 |
domainCode = __mkSmallInteger(AF_INET6); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4814 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4815 |
#ifdef AF_UNIX |
8669 | 4816 |
else if ((aSymbolOrInteger == @symbol(AF_UNIX)) || (aSymbolOrInteger == @symbol(unix))) |
8913 | 4817 |
domainCode = __mkSmallInteger(AF_UNIX); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4818 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4819 |
#ifdef AF_APPLETALK |
8669 | 4820 |
else if ((aSymbolOrInteger == @symbol(AF_APPLETALK)) || (aSymbolOrInteger == @symbol(appletalk))) |
8913 | 4821 |
domainCode = __mkSmallInteger(AF_APPLETALK); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4822 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4823 |
#ifdef AF_DECnet |
8669 | 4824 |
else if ((aSymbolOrInteger == @symbol(AF_DECnet)) || (aSymbolOrInteger == @symbol(decnet))) |
8913 | 4825 |
domainCode = __mkSmallInteger(AF_DECnet); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4826 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4827 |
#ifdef AF_NS |
8669 | 4828 |
else if ((aSymbolOrInteger == @symbol(AF_NS)) || (aSymbolOrInteger == @symbol(ns))) |
8913 | 4829 |
domainCode = __mkSmallInteger(AF_NS); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4830 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4831 |
#ifdef AF_X25 |
8669 | 4832 |
else if ((aSymbolOrInteger == @symbol(AF_X25)) || (aSymbolOrInteger == @symbol(x25))) |
8913 | 4833 |
domainCode = __mkSmallInteger(AF_X25); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4834 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4835 |
#ifdef AF_SNA |
8669 | 4836 |
else if (aSymbolOrInteger == @symbol(AF_SNA)) |
8913 | 4837 |
domainCode = __mkSmallInteger(AF_SNA); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4838 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4839 |
#ifdef AF_RAW |
8669 | 4840 |
else if ((aSymbolOrInteger == @symbol(AF_RAW)) || (aSymbolOrInteger == @symbol(raw))) |
8913 | 4841 |
domainCode = __mkSmallInteger(AF_RAW); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4842 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4843 |
#ifdef AF_ISO |
8669 | 4844 |
else if ((aSymbolOrInteger == @symbol(AF_ISO)) || (aSymbolOrInteger == @symbol(iso))) |
8913 | 4845 |
domainCode = __mkSmallInteger(AF_ISO); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4846 |
#endif |
8784 | 4847 |
#ifdef AF_ECMA |
4848 |
else if (aSymbolOrInteger == @symbol(AF_ECMA)) |
|
8913 | 4849 |
domainCode = __mkSmallInteger(AF_ECMA); |
8784 | 4850 |
#endif |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4851 |
#ifdef AF_NETBIOS |
8669 | 4852 |
else if ((aSymbolOrInteger == @symbol(AF_NETBIOS)) || (aSymbolOrInteger == @symbol(netbios))) |
8913 | 4853 |
domainCode = __mkSmallInteger(AF_NETBIOS); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4854 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4855 |
#ifdef AF_NETBEUI |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4856 |
else if (aSymbolOrInteger == @symbol(AF_NETBEUI)) |
8913 | 4857 |
domainCode = __mkSmallInteger(AF_NETBEUI); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4858 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4859 |
#ifdef AF_IPX |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4860 |
else if (aSymbolOrInteger == @symbol(AF_IPX)) |
8913 | 4861 |
domainCode = __mkSmallInteger(AF_IPX); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4862 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4863 |
#ifdef AF_AX25 |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4864 |
else if (aSymbolOrInteger == @symbol(AF_AX25)) |
8913 | 4865 |
domainCode = __mkSmallInteger(AF_AX25); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4866 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4867 |
#ifdef AF_NETROM |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4868 |
else if (aSymbolOrInteger == @symbol(AF_NETROM)) |
8913 | 4869 |
domainCode = __mkSmallInteger(AF_NETROM); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4870 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4871 |
#ifdef AF_BRIDGE |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4872 |
else if (aSymbolOrInteger == @symbol(AF_BRIDGE)) |
8913 | 4873 |
domainCode = __mkSmallInteger(AF_BRIDGE); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4874 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4875 |
#ifdef AF_BSC |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4876 |
else if (aSymbolOrInteger == @symbol(AF_BSC)) |
8913 | 4877 |
domainCode = __mkSmallInteger(AF_BSC); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4878 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4879 |
#ifdef AF_ROSE |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4880 |
else if (aSymbolOrInteger == @symbol(AF_ROSE)) |
8913 | 4881 |
domainCode = __mkSmallInteger(AF_ROSE); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4882 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4883 |
#ifdef AF_IRDA |
8669 | 4884 |
else if ((aSymbolOrInteger == @symbol(AF_IRDA)) || (aSymbolOrInteger == @symbol(irda))) |
8913 | 4885 |
domainCode = __mkSmallInteger(AF_IRDA); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4886 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4887 |
#ifdef AF_BAN |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4888 |
else if (aSymbolOrInteger == @symbol(AF_BAN)) |
8913 | 4889 |
domainCode = __mkSmallInteger(AF_BAN); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4890 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4891 |
#ifdef AF_VOICEVIEW |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4892 |
else if (aSymbolOrInteger == @symbol(AF_VOICEVIEW)) |
8913 | 4893 |
domainCode = __mkSmallInteger(AF_VOICEVIEW); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4894 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4895 |
#ifdef AF_ATM |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4896 |
else if (aSymbolOrInteger == @symbol(AF_ATM)) |
8913 | 4897 |
domainCode = __mkSmallInteger(AF_ATM); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4898 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4899 |
#ifdef AF_ATMPVC |
8669 | 4900 |
else if (aSymbolOrInteger == @symbol(AF_ATMPVC)) |
8913 | 4901 |
domainCode = __mkSmallInteger(AF_ATMPVC); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4902 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4903 |
#ifdef AF_ATMSVC |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4904 |
else if (aSymbolOrInteger == @symbol(AF_ATMSVC)) |
8913 | 4905 |
domainCode = __mkSmallInteger(AF_ATMSVC); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4906 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4907 |
#ifdef AF_SECURITY |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4908 |
else if (aSymbolOrInteger == @symbol(AF_SECURITY)) |
8913 | 4909 |
domainCode = __mkSmallInteger(AF_SECURITY); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4910 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4911 |
#ifdef AF_KEY |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4912 |
else if (aSymbolOrInteger == @symbol(AF_KEY)) |
8913 | 4913 |
domainCode = __mkSmallInteger(AF_KEY); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4914 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4915 |
#ifdef AF_NETLINK |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4916 |
else if (aSymbolOrInteger == @symbol(AF_NETLINK)) |
8913 | 4917 |
domainCode = __mkSmallInteger(AF_NETLINK); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4918 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4919 |
#ifdef AF_PACKET |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4920 |
else if (aSymbolOrInteger == @symbol(AF_PACKET)) |
8913 | 4921 |
domainCode = __mkSmallInteger(AF_PACKET); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4922 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4923 |
#ifdef AF_ASH |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4924 |
else if (aSymbolOrInteger == @symbol(AF_ASH)) |
8913 | 4925 |
domainCode = __mkSmallInteger(AF_ASH); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4926 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4927 |
#ifdef AF_ECONET |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4928 |
else if (aSymbolOrInteger == @symbol(AF_ECONET)) |
8913 | 4929 |
domainCode = __mkSmallInteger(AF_ECONET); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4930 |
#endif |
7716 | 4931 |
#ifdef AF_IMPLINK |
4932 |
else if (aSymbolOrInteger == @symbol(AF_IMPLINK)) |
|
8913 | 4933 |
domainCode = __mkSmallInteger(AF_IMPLINK); |
7716 | 4934 |
#endif |
8784 | 4935 |
#ifdef AF_PUP |
4936 |
else if (aSymbolOrInteger == @symbol(AF_PUP)) |
|
8913 | 4937 |
domainCode = __mkSmallInteger(AF_PUP); |
8784 | 4938 |
#endif |
7716 | 4939 |
#ifdef AF_CHAOS |
4940 |
else if (aSymbolOrInteger == @symbol(AF_CHAOS)) |
|
8913 | 4941 |
domainCode = __mkSmallInteger(AF_CHAOS); |
7716 | 4942 |
#endif |
4943 |
#ifdef AF_DLI |
|
4944 |
else if (aSymbolOrInteger == @symbol(AF_DLI)) |
|
8913 | 4945 |
domainCode = __mkSmallInteger(AF_DLI); |
7716 | 4946 |
#endif |
4947 |
#ifdef AF_LAT |
|
4948 |
else if (aSymbolOrInteger == @symbol(AF_LAT)) |
|
8913 | 4949 |
domainCode = __mkSmallInteger(AF_LAT); |
7716 | 4950 |
#endif |
4951 |
#ifdef AF_HYLINK |
|
4952 |
else if (aSymbolOrInteger == @symbol(AF_HYLINK)) |
|
8913 | 4953 |
domainCode = __mkSmallInteger(AF_HYLINK); |
7716 | 4954 |
#endif |
4955 |
#ifdef AF_FIREFOX |
|
4956 |
else if (aSymbolOrInteger == @symbol(AF_FIREFOX)) |
|
8913 | 4957 |
domainCode = __mkSmallInteger(AF_FIREFOX); |
7716 | 4958 |
#endif |
4959 |
#ifdef AF_CLUSTER |
|
4960 |
else if (aSymbolOrInteger == @symbol(AF_CLUSTER)) |
|
8913 | 4961 |
domainCode = __mkSmallInteger(AF_CLUSTER); |
7716 | 4962 |
#endif |
4963 |
#ifdef AF_12844 |
|
4964 |
else if (aSymbolOrInteger == @symbol(AF_12844)) |
|
8913 | 4965 |
domainCode = __mkSmallInteger(AF_12844); |
7716 | 4966 |
#endif |
4967 |
#ifdef AF_NETDES |
|
4968 |
else if (aSymbolOrInteger == @symbol(AF_NETDES)) |
|
8913 | 4969 |
domainCode = __mkSmallInteger(AF_NETDES); |
7716 | 4970 |
#endif |
16499 | 4971 |
#ifdef AF_CCITT |
4972 |
else if (aSymbolOrInteger == @symbol(AF_CCITT)) |
|
4973 |
domainCode = __mkSmallInteger(AF_CCITT); |
|
4974 |
#endif |
|
4975 |
#ifdef AF_ISDN |
|
4976 |
else if (aSymbolOrInteger == @symbol(AF_ISDN)) |
|
4977 |
domainCode = __mkSmallInteger(AF_ISDN); |
|
4978 |
#endif |
|
4979 |
#ifdef AF_SYSTEM |
|
4980 |
else if (aSymbolOrInteger == @symbol(AF_SYSTEM)) |
|
4981 |
domainCode = __mkSmallInteger(AF_SYSTEM); |
|
4982 |
#endif |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4983 |
%}. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4984 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4985 |
^ domainCode. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4986 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4987 |
" |
8669 | 4988 |
self domainCodeOf:#AF_INET |
4989 |
self domainCodeOf:#AF_INET6 |
|
4990 |
self domainCodeOf:#AF_UNIX |
|
4991 |
self domainCodeOf:#AF_APPLETALK |
|
4992 |
self domainCodeOf:#AF_DECNET |
|
4993 |
" |
|
4994 |
"for backward compatibility only: |
|
4995 |
self domainCodeOf:#inet |
|
4996 |
self domainCodeOf:#inet6 |
|
4997 |
self domainCodeOf:#unix |
|
4998 |
self domainCodeOf:#appletalk |
|
4999 |
self domainCodeOf:#decnet |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5000 |
" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5001 |
! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5002 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5003 |
domainSymbolOf:anInteger |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5004 |
"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
|
5005 |
Return nil for invalid or unsupported domains." |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5006 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5007 |
|domainSymbol| |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5008 |
|
8669 | 5009 |
%{ /*NOCONTEXT*/ |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5010 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5011 |
if (__isSmallInteger(anInteger)) { |
13891 | 5012 |
switch(__intVal(anInteger)) { |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5013 |
#ifdef AF_INET |
13891 | 5014 |
case AF_INET: |
5015 |
domainSymbol = @symbol(AF_INET); |
|
5016 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5017 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5018 |
#ifdef AF_INET6 |
13891 | 5019 |
case AF_INET6: |
5020 |
domainSymbol = @symbol(AF_INET6); |
|
5021 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5022 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5023 |
#ifdef AF_UNIX |
13891 | 5024 |
case AF_UNIX: |
5025 |
domainSymbol = @symbol(AF_UNIX); |
|
5026 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5027 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5028 |
#ifdef AF_APPLETALK |
13891 | 5029 |
case AF_APPLETALK: |
5030 |
domainSymbol = @symbol(AF_APPLETALK); |
|
5031 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5032 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5033 |
#ifdef AF_DECnet |
13891 | 5034 |
case AF_DECnet: |
5035 |
domainSymbol = @symbol(AF_DECnet); |
|
5036 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5037 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5038 |
#ifdef AF_NS |
13891 | 5039 |
case AF_NS: |
5040 |
domainSymbol = @symbol(AF_NS); |
|
5041 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5042 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5043 |
#ifdef AF_X25 |
13891 | 5044 |
case AF_X25: |
5045 |
domainSymbol = @symbol(AF_X25); |
|
5046 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5047 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5048 |
#ifdef AF_SNA |
13891 | 5049 |
case AF_SNA: |
5050 |
domainSymbol = @symbol(AF_SNA); |
|
5051 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5052 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5053 |
#ifdef AF_RAW |
13891 | 5054 |
case AF_RAW: |
5055 |
domainSymbol = @symbol(AF_RAW); |
|
5056 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5057 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5058 |
#ifdef AF_ISO |
13891 | 5059 |
case AF_ISO: |
5060 |
domainSymbol = @symbol(AF_ISO); |
|
5061 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5062 |
#endif |
8784 | 5063 |
#ifdef AF_ECMA |
13891 | 5064 |
case AF_ECMA: |
5065 |
domainSymbol = @symbol(AF_ECMA); |
|
5066 |
break; |
|
8784 | 5067 |
#endif |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5068 |
#ifdef AF_NETBIOS |
13891 | 5069 |
case AF_NETBIOS: |
5070 |
domainSymbol = @symbol(AF_NETBIOS); |
|
5071 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5072 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5073 |
#ifdef AF_IPX |
14846
ebbd3993788d
oops - duplicate case: AF_NS is the same as AF_IPX on windows
Claus Gittinger <cg@exept.de>
parents:
14845
diff
changeset
|
5074 |
# if defined(AF_NS) && (AF_NS == AF_IPX) |
ebbd3993788d
oops - duplicate case: AF_NS is the same as AF_IPX on windows
Claus Gittinger <cg@exept.de>
parents:
14845
diff
changeset
|
5075 |
// alias |
ebbd3993788d
oops - duplicate case: AF_NS is the same as AF_IPX on windows
Claus Gittinger <cg@exept.de>
parents:
14845
diff
changeset
|
5076 |
# else |
13891 | 5077 |
case AF_IPX: |
5078 |
domainSymbol = @symbol(AF_IPX); |
|
5079 |
break; |
|
14846
ebbd3993788d
oops - duplicate case: AF_NS is the same as AF_IPX on windows
Claus Gittinger <cg@exept.de>
parents:
14845
diff
changeset
|
5080 |
# endif |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5081 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5082 |
#ifdef AF_AX25 |
13891 | 5083 |
case AF_AX25: |
5084 |
domainSymbol = @symbol(AF_AX25); |
|
5085 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5086 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5087 |
#ifdef AF_NETROM |
13891 | 5088 |
case AF_NETROM: |
5089 |
domainSymbol = @symbol(AF_NETROM); |
|
5090 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5091 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5092 |
#ifdef AF_BRIDGE |
13891 | 5093 |
case AF_BRIDGE: |
5094 |
domainSymbol = @symbol(AF_BRIDGE); |
|
5095 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5096 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5097 |
#ifdef AF_BSC |
13891 | 5098 |
case AF_BSC: |
5099 |
domainSymbol = @symbol(AF_BSC); |
|
5100 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5101 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5102 |
#ifdef AF_ROSE |
13891 | 5103 |
case AF_ROSE: |
5104 |
domainSymbol = @symbol(AF_ROSE); |
|
5105 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5106 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5107 |
#ifdef AF_IRDA |
13891 | 5108 |
case AF_IRDA: |
5109 |
domainSymbol = @symbol(AF_IRDA); |
|
5110 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5111 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5112 |
#ifdef AF_BAN |
13891 | 5113 |
case AF_BAN: |
5114 |
domainSymbol = @symbol(AF_BAN); |
|
5115 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5116 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5117 |
#ifdef AF_VOICEVIEW |
13891 | 5118 |
case AF_VOICEVIEW: |
5119 |
domainSymbol = @symbol(AF_VOICEVIEW); |
|
5120 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5121 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5122 |
#ifdef AF_ATM |
13891 | 5123 |
case AF_ATM: |
5124 |
domainSymbol = @symbol(AF_ATM); |
|
5125 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5126 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5127 |
#ifdef AF_ATMPVC |
13891 | 5128 |
case AF_ATMPVC: |
5129 |
domainSymbol = @symbol(AF_ATMPVC); |
|
5130 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5131 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5132 |
#ifdef AF_ATMSVC |
13891 | 5133 |
case AF_ATMSVC: |
5134 |
domainSymbol = @symbol(AF_ATMSVC); |
|
5135 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5136 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5137 |
#ifdef AF_SECURITY |
13891 | 5138 |
case AF_SECURITY: |
5139 |
domainSymbol = @symbol(AF_SECURITY); |
|
5140 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5141 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5142 |
#ifdef AF_KEY |
13891 | 5143 |
case AF_KEY: |
5144 |
domainSymbol = @symbol(AF_KEY); |
|
5145 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5146 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5147 |
#ifdef AF_NETLINK |
13891 | 5148 |
case AF_NETLINK: |
5149 |
domainSymbol = @symbol(AF_NETLINK); |
|
5150 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5151 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5152 |
#ifdef AF_PACKET |
13891 | 5153 |
case AF_PACKET: |
5154 |
domainSymbol = @symbol(AF_PACKET); |
|
5155 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5156 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5157 |
#ifdef AF_ASH |
13891 | 5158 |
case AF_ASH: |
5159 |
domainSymbol = @symbol(AF_ASH); |
|
5160 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5161 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5162 |
#ifdef AF_ECONET |
13891 | 5163 |
case AF_ECONET: |
5164 |
domainSymbol = @symbol(AF_ECONET); |
|
5165 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5166 |
#endif |
7716 | 5167 |
#ifdef AF_IMPLINK |
13891 | 5168 |
case AF_IMPLINK: |
5169 |
domainSymbol = @symbol(AF_IMPLINK); |
|
5170 |
break; |
|
7716 | 5171 |
#endif |
8784 | 5172 |
#ifdef AF_PUP |
13891 | 5173 |
case AF_PUP: |
5174 |
domainSymbol = @symbol(AF_PUP); |
|
5175 |
break; |
|
8784 | 5176 |
#endif |
7716 | 5177 |
#ifdef AF_CHAOS |
13891 | 5178 |
case AF_CHAOS: |
5179 |
domainSymbol = @symbol(AF_CHAOS); |
|
5180 |
break; |
|
7716 | 5181 |
#endif |
5182 |
#ifdef AF_DLI |
|
13891 | 5183 |
case AF_DLI: |
5184 |
domainSymbol = @symbol(AF_DLI); |
|
5185 |
break; |
|
7716 | 5186 |
#endif |
5187 |
#ifdef AF_LAT |
|
13891 | 5188 |
case AF_LAT: |
5189 |
domainSymbol = @symbol(AF_LAT); |
|
5190 |
break; |
|
7716 | 5191 |
#endif |
5192 |
#ifdef AF_HYLINK |
|
13891 | 5193 |
case AF_HYLINK: |
5194 |
domainSymbol = @symbol(AF_HYLINK); |
|
5195 |
break; |
|
7716 | 5196 |
#endif |
5197 |
#ifdef AF_FIREFOX |
|
13891 | 5198 |
case AF_FIREFOX: |
5199 |
domainSymbol = @symbol(AF_FIREFOX); |
|
5200 |
break; |
|
7716 | 5201 |
#endif |
5202 |
#ifdef AF_CLUSTER |
|
13891 | 5203 |
case AF_CLUSTER: |
5204 |
domainSymbol = @symbol(AF_CLUSTER); |
|
5205 |
break; |
|
7716 | 5206 |
#endif |
5207 |
#ifdef AF_12844 |
|
13891 | 5208 |
case AF_12844: |
5209 |
domainSymbol = @symbol(AF_12844); |
|
5210 |
break; |
|
7716 | 5211 |
#endif |
5212 |
#ifdef AF_NETDES |
|
13891 | 5213 |
case AF_NETDES: |
5214 |
domainSymbol = @symbol(AF_NETDES); |
|
5215 |
break; |
|
5216 |
#endif |
|
16499 | 5217 |
#ifdef AF_CCITT |
5218 |
case AF_CCITT: |
|
5219 |
domainSymbol = @symbol(AF_CCITT); |
|
5220 |
break; |
|
5221 |
#endif |
|
5222 |
#ifdef AF_ISDN |
|
5223 |
case AF_ISDN: |
|
5224 |
domainSymbol = @symbol(AF_ISDN); |
|
5225 |
break; |
|
5226 |
#endif |
|
5227 |
#ifdef AF_SYSTEM |
|
5228 |
case AF_SYSTEM: |
|
5229 |
domainSymbol = @symbol(AF_SYSTEM); |
|
5230 |
break; |
|
5231 |
#endif |
|
13891 | 5232 |
} |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5233 |
} |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5234 |
%}. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5235 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5236 |
^ domainSymbol. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5237 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5238 |
" |
8669 | 5239 |
self domainSymbolOf:(self domainCodeOf:#inet) |
5240 |
self domainSymbolOf:(self domainCodeOf:#inet6) |
|
5241 |
self domainSymbolOf:(self domainCodeOf:#unix) |
|
5242 |
self domainSymbolOf:(self domainCodeOf:#appletalk) |
|
5243 |
self domainSymbolOf:(self domainCodeOf:#decnet) |
|
5244 |
self domainSymbolOf:(self domainCodeOf:#raw) |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5245 |
" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5246 |
! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5247 |
|
8784 | 5248 |
protocolCodeOf:aSymbolOrInteger |
5249 |
"return the numeric IPPROTO_xxx code of a given symbolic protocol name. |
|
5250 |
Return nil for invalid or unsupported protocols. |
|
5251 |
For backward compatibility, the obsolete (non-IPPROTO-prefixed) names |
|
5252 |
are still supported for a while - this support will vanish." |
|
5253 |
||
5254 |
|protocolCode| |
|
5255 |
||
5256 |
%{ /*NOCONTEXT*/ |
|
5257 |
||
5258 |
if (__isSmallInteger(aSymbolOrInteger) || aSymbolOrInteger == nil) { |
|
13891 | 5259 |
RETURN (aSymbolOrInteger); |
8784 | 5260 |
} |
5261 |
||
5262 |
#ifdef IPPROTO_IP |
|
5263 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_IP)) || (aSymbolOrInteger == @symbol(ip))) |
|
8913 | 5264 |
protocolCode = __mkSmallInteger(IPPROTO_IP); |
8784 | 5265 |
#endif |
5266 |
#ifdef IPPROTO_ICMP |
|
5267 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_ICMP)) || (aSymbolOrInteger == @symbol(icmp))) |
|
8913 | 5268 |
protocolCode = __mkSmallInteger(IPPROTO_ICMP); |
8784 | 5269 |
#endif |
5270 |
#ifdef IPPROTO_IGMP |
|
5271 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_IGMP)) || (aSymbolOrInteger == @symbol(igmp))) |
|
8913 | 5272 |
protocolCode = __mkSmallInteger(IPPROTO_IGMP); |
8784 | 5273 |
#endif |
5274 |
#ifdef IPPROTO_GGP |
|
5275 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_GGP)) || (aSymbolOrInteger == @symbol(ggp))) |
|
8913 | 5276 |
protocolCode = __mkSmallInteger(IPPROTO_GGP); |
8784 | 5277 |
#endif |
5278 |
#ifdef IPPROTO_TCP |
|
5279 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_TCP)) || (aSymbolOrInteger == @symbol(tcp))) |
|
8913 | 5280 |
protocolCode = __mkSmallInteger(IPPROTO_TCP); |
8784 | 5281 |
#endif |
5282 |
#ifdef IPPROTO_UDP |
|
5283 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_UDP)) || (aSymbolOrInteger == @symbol(udp))) |
|
8913 | 5284 |
protocolCode = __mkSmallInteger(IPPROTO_UDP); |
8784 | 5285 |
#endif |
5286 |
#ifdef IPPROTO_IDP |
|
5287 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_IDP)) || (aSymbolOrInteger == @symbol(idp))) |
|
8913 | 5288 |
protocolCode = __mkSmallInteger(IPPROTO_IDP); |
8784 | 5289 |
#endif |
5290 |
#ifdef IPPROTO_ND |
|
5291 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_ND)) || (aSymbolOrInteger == @symbol(nd))) |
|
8913 | 5292 |
protocolCode = __mkSmallInteger(IPPROTO_ND); |
8784 | 5293 |
#endif |
5294 |
#ifdef IPPROTO_RAW |
|
5295 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_RAW)) || (aSymbolOrInteger == @symbol(raw))) |
|
8913 | 5296 |
protocolCode = __mkSmallInteger(IPPROTO_RAW); |
8784 | 5297 |
#endif |
5298 |
%}. |
|
5299 |
||
5300 |
^ protocolCode. |
|
5301 |
||
5302 |
" |
|
5303 |
self protocolCodeOf:#IPPROTO_UDP |
|
5304 |
self protocolCodeOf:#IPPROTO_TCP |
|
5305 |
" |
|
5306 |
"for backward compatibility only: |
|
5307 |
self protocolCodeOf:#udp |
|
5308 |
self protocolCodeOf:#tcp |
|
5309 |
" |
|
5310 |
! |
|
5311 |
||
5312 |
protocolSymbolOf:anInteger |
|
5313 |
"return the symbolic protocolName of a given numeric IPPROTO_xxx code. |
|
5314 |
Return nil for invalid or unsupported protocols." |
|
5315 |
||
5316 |
|protocolSymbol| |
|
5317 |
||
5318 |
%{ /*NOCONTEXT*/ |
|
5319 |
||
5320 |
if (__isSmallInteger(anInteger)) { |
|
13891 | 5321 |
switch(__intVal(anInteger)) { |
8784 | 5322 |
#ifdef IPPROTO_IP |
13891 | 5323 |
case IPPROTO_IP: |
5324 |
// protocolSymbol = @symbol(IPPROTO_IP); |
|
5325 |
protocolSymbol = @symbol(ip); |
|
5326 |
break; |
|
8784 | 5327 |
#endif |
5328 |
#ifdef IPPROTO_ICMP |
|
13891 | 5329 |
case IPPROTO_ICMP: |
5330 |
// protocolSymbol = @symbol(IPPROTO_ICMP); |
|
5331 |
protocolSymbol = @symbol(icmp); |
|
5332 |
break; |
|
8784 | 5333 |
#endif |
5334 |
#ifdef IPPROTO_IGMP |
|
13891 | 5335 |
case IPPROTO_IGMP: |
5336 |
// protocolSymbol = @symbol(IPPROTO_IGMP); |
|
5337 |
protocolSymbol = @symbol(igmp); |
|
5338 |
break; |
|
8784 | 5339 |
#endif |
5340 |
#ifdef IPPROTO_GGP |
|
13891 | 5341 |
case IPPROTO_GGP: |
5342 |
// protocolSymbol = @symbol(IPPROTO_GGP); |
|
5343 |
protocolSymbol = @symbol(ggp); |
|
5344 |
break; |
|
8784 | 5345 |
#endif |
5346 |
#ifdef IPPROTO_TCP |
|
13891 | 5347 |
case IPPROTO_TCP: |
5348 |
// protocolSymbol = @symbol(IPPROTO_TCP); |
|
5349 |
protocolSymbol = @symbol(tcp); |
|
5350 |
break; |
|
8784 | 5351 |
#endif |
5352 |
#ifdef IPPROTO_PUP |
|
13891 | 5353 |
case IPPROTO_PUP: |
5354 |
// protocolSymbol = @symbol(IPPROTO_PUP); |
|
5355 |
protocolSymbol = @symbol(pup); |
|
5356 |
break; |
|
8784 | 5357 |
#endif |
5358 |
#ifdef IPPROTO_UDP |
|
13891 | 5359 |
case IPPROTO_UDP: |
5360 |
// protocolSymbol = @symbol(IPPROTO_UDP); |
|
5361 |
protocolSymbol = @symbol(udp); |
|
5362 |
break; |
|
8784 | 5363 |
#endif |
5364 |
#ifdef IPPROTO_IDP |
|
13891 | 5365 |
case IPPROTO_IDP: |
5366 |
// protocolSymbol = @symbol(IPPROTO_IDP); |
|
5367 |
protocolSymbol = @symbol(idp); |
|
5368 |
break; |
|
8784 | 5369 |
#endif |
5370 |
#ifdef IPPROTO_ND |
|
13891 | 5371 |
case IPPROTO_ND: |
5372 |
// protocolSymbol = @symbol(IPPROTO_ND); |
|
5373 |
protocolSymbol = @symbol(nd); |
|
5374 |
break; |
|
8784 | 5375 |
#endif |
5376 |
#ifdef IPPROTO_RAW |
|
13891 | 5377 |
case IPPROTO_RAW: |
5378 |
// protocolSymbol = @symbol(IPPROTO_RAW); |
|
5379 |
protocolSymbol = @symbol(raw); |
|
5380 |
break; |
|
5381 |
#endif |
|
5382 |
} |
|
8784 | 5383 |
} |
5384 |
%}. |
|
5385 |
||
5386 |
^ protocolSymbol. |
|
5387 |
||
5388 |
" |
|
5389 |
self protocolSymbolOf:(self protocolCodeOf:#tcp) |
|
5390 |
self protocolSymbolOf:(self protocolCodeOf:#udp) |
|
5391 |
self protocolSymbolOf:(self protocolCodeOf:#raw) |
|
5392 |
" |
|
5393 |
! |
|
5394 |
||
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5395 |
socketAddressSizeOfDomain:aSymbolOrInteger |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5396 |
"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
|
5397 |
Return nil, if unknown or unsupported." |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5398 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5399 |
|socketSize domainCode| |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5400 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5401 |
domainCode := OperatingSystem domainCodeOf:aSymbolOrInteger. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5402 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5403 |
%{ |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5404 |
if (__isSmallInteger(domainCode)) { |
13891 | 5405 |
switch (__intVal(domainCode)) { |
14845 | 5406 |
#ifdef WANT__AF_INET |
13891 | 5407 |
case AF_INET: |
5408 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_in) ); |
|
5409 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5410 |
#endif |
14845 | 5411 |
#ifdef WANT__AF_INET6 |
13891 | 5412 |
case AF_INET6: |
5413 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_in6) ); |
|
5414 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5415 |
#endif |
14845 | 5416 |
#ifdef WANT__AF_UNIX |
13891 | 5417 |
case AF_UNIX: |
5418 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_un) ); |
|
5419 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5420 |
#endif |
14845 | 5421 |
#ifdef WANT__AF_APPLETALK |
13891 | 5422 |
case AF_APPLETALK: |
5423 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_at) ); |
|
5424 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5425 |
#endif |
14845 | 5426 |
#ifdef WANT__AF_DECnet |
13891 | 5427 |
case AF_DECnet: |
5428 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_dn) ); |
|
5429 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5430 |
#endif |
14845 | 5431 |
#ifdef WANT__AF_NS |
13891 | 5432 |
case AF_NS: |
5433 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_ns) ); |
|
5434 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5435 |
#endif |
14845 | 5436 |
#ifdef WANT__AF_X25 |
13891 | 5437 |
case AF_X25: |
5438 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_x25) ); |
|
5439 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5440 |
#endif |
14845 | 5441 |
#ifdef WANT__AF_SNA |
13891 | 5442 |
case AF_SNA: |
5443 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_sna) ); |
|
5444 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5445 |
#endif |
14845 | 5446 |
#ifdef WANT__AF_RAW |
13891 | 5447 |
case AF_RAW: |
5448 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_raw) ); |
|
5449 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5450 |
#endif |
14845 | 5451 |
#ifdef WANT__AF_ISO |
13891 | 5452 |
case AF_ISO: |
5453 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_iso) ); |
|
5454 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5455 |
#endif |
14845 | 5456 |
#ifdef WANT__AF_ECMA |
8784 | 5457 |
# if 0 |
13891 | 5458 |
case AF_ECMA: |
5459 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_ecma) ); |
|
5460 |
break; |
|
8784 | 5461 |
# endif |
5462 |
#endif |
|
14845 | 5463 |
#ifdef WANT__AF_NETBIOS |
13891 | 5464 |
case AF_NETBIOS: |
5465 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_netbios) ); |
|
5466 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5467 |
#endif |
14845 | 5468 |
#ifdef WANT__AF_NETBEUI |
13891 | 5469 |
case AF_NETBEUI: |
5470 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_netbeui) ); |
|
5471 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5472 |
#endif |
14845 | 5473 |
#ifdef WANT__AF_IPX |
13891 | 5474 |
case AF_IPX: |
5475 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_ipx) ); |
|
5476 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5477 |
#endif |
14845 | 5478 |
#ifdef WANT__AF_AX25 |
13891 | 5479 |
case AF_AX25: |
5480 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_ax25) ); |
|
5481 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5482 |
#endif |
14845 | 5483 |
#ifdef WANT__AF_NETROM |
13891 | 5484 |
case AF_NETROM: |
5485 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_netrom) ); |
|
5486 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5487 |
#endif |
14845 | 5488 |
#ifdef WANT__AF_BRIDGE |
13891 | 5489 |
case AF_BRIDGE: |
5490 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_bridge) ); |
|
5491 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5492 |
#endif |
14845 | 5493 |
#ifdef WANT__AF_BSC |
13891 | 5494 |
case AF_BSC: |
5495 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_bsc) ); |
|
5496 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5497 |
#endif |
14845 | 5498 |
#ifdef WANT__AF_ROSE |
13891 | 5499 |
case AF_ROSE: |
5500 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_rose) ); |
|
5501 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5502 |
#endif |
14845 | 5503 |
#ifdef WANT__AF_IRDA |
13891 | 5504 |
case AF_IRDA: |
5505 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_irda) ); |
|
5506 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5507 |
#endif |
14845 | 5508 |
#ifdef WANT__AF_BAN |
13891 | 5509 |
case AF_BAN: |
5510 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_ban) ); |
|
5511 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5512 |
#endif |
14845 | 5513 |
#ifdef WANT__AF_VOICEVIEW |
13891 | 5514 |
case AF_VOICEVIEW: |
5515 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_voiceview) ); |
|
5516 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5517 |
#endif |
14845 | 5518 |
#ifdef WANT__AF_ATM |
13891 | 5519 |
case AF_ATM: |
5520 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_atm) ); |
|
5521 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5522 |
#endif |
14845 | 5523 |
#ifdef WANT__AF_ATMPVC |
13891 | 5524 |
case AF_ATMPVC: |
5525 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_atmpvc) ); |
|
5526 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5527 |
#endif |
14845 | 5528 |
#ifdef WANT__AF_ATMSVC |
13891 | 5529 |
case AF_ATMSVC: |
5530 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_atmsvc) ); |
|
5531 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5532 |
#endif |
14845 | 5533 |
#ifdef WANT__AF_NETLINK |
13891 | 5534 |
case AF_NETLINK: |
5535 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_netlink) ); |
|
5536 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5537 |
#endif |
14845 | 5538 |
#ifdef WANT__AF_PACKET |
13891 | 5539 |
case AF_PACKET: |
5540 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_packet) ); |
|
5541 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5542 |
#endif |
14845 | 5543 |
#ifdef WANT__AF_ASH |
13891 | 5544 |
case AF_ASH: |
5545 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_ash) ); |
|
5546 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5547 |
#endif |
14845 | 5548 |
#ifdef WANT__AF_ECONET |
13891 | 5549 |
case AF_ECONET: |
5550 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_eco) ); |
|
5551 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5552 |
#endif |
14845 | 5553 |
#ifdef WANT__AF_IMPLINK |
13891 | 5554 |
case AF_IMPLINK: |
5555 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_implink) ); |
|
5556 |
break; |
|
7716 | 5557 |
#endif |
14845 | 5558 |
#ifdef WANT__AF_PUP |
8784 | 5559 |
# if 0 |
13891 | 5560 |
case AF_PUP: |
5561 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_pup) ); |
|
5562 |
break; |
|
8784 | 5563 |
# endif |
5564 |
#endif |
|
14845 | 5565 |
#ifdef WANT__AF_CHAOS |
13891 | 5566 |
case AF_CHAOS: |
5567 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_chaos) ); |
|
5568 |
break; |
|
7716 | 5569 |
#endif |
14845 | 5570 |
#ifdef WANT__AF_DLI |
13891 | 5571 |
case AF_DLI: |
5572 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_dli) ); |
|
5573 |
break; |
|
7716 | 5574 |
#endif |
14845 | 5575 |
#ifdef WANT__AF_LAT |
13891 | 5576 |
case AF_LAT: |
5577 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_lat) ); |
|
5578 |
break; |
|
7716 | 5579 |
#endif |
14845 | 5580 |
#ifdef WANT__AF_HYLINK |
13891 | 5581 |
case AF_HYLINK: |
5582 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_hylink) ); |
|
5583 |
break; |
|
7716 | 5584 |
#endif |
14845 | 5585 |
#ifdef WANT__AF_FIREFOX |
13891 | 5586 |
case AF_FIREFOX: |
5587 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_firefox) ); |
|
5588 |
break; |
|
7716 | 5589 |
#endif |
14845 | 5590 |
#ifdef WANT__AF_CLUSTER |
13891 | 5591 |
case AF_CLUSTER: |
5592 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_cluster) ); |
|
5593 |
break; |
|
7716 | 5594 |
#endif |
14845 | 5595 |
#ifdef WANT__AF_12844 |
13891 | 5596 |
case AF_12844: |
5597 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_12844) ); |
|
5598 |
break; |
|
7716 | 5599 |
#endif |
14845 | 5600 |
#ifdef WANT__AF_NETDES |
13891 | 5601 |
case AF_NETDES: |
5602 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_netdes) ); |
|
5603 |
break; |
|
5604 |
#endif |
|
16499 | 5605 |
#ifdef WANT__AF_CCITT |
5606 |
case AF_CCITT: |
|
5607 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_ccitt) ); |
|
5608 |
break; |
|
5609 |
#endif |
|
5610 |
#ifdef WANT__AF_ISDN |
|
5611 |
case AF_ISDN: |
|
5612 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_isdn) ); |
|
5613 |
break; |
|
5614 |
#endif |
|
5615 |
#ifdef WANT__AF_SYSTEM |
|
5616 |
case AF_SYSTEM: |
|
5617 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_sys) ); |
|
5618 |
break; |
|
5619 |
#endif |
|
5620 |
||
13891 | 5621 |
} |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5622 |
} |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5623 |
%}. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5624 |
^ socketSize |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5625 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5626 |
" |
8669 | 5627 |
self socketAddressSizeOfDomain:#'AF_INET' |
5628 |
self socketAddressSizeOfDomain:#'AF_UNIX' |
|
5629 |
self socketAddressSizeOfDomain:#'Foo' |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5630 |
" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5631 |
! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5632 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5633 |
socketTypeCodeOf:aSymbolOrInteger |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5634 |
"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
|
5635 |
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
|
5636 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5637 |
|typeCode| |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5638 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5639 |
%{ /*NOCONTEXT*/ |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5640 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5641 |
if (__isSmallInteger(aSymbolOrInteger) || aSymbolOrInteger == nil) { |
13891 | 5642 |
typeCode = aSymbolOrInteger; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5643 |
} |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5644 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5645 |
#ifdef SOCK_STREAM |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5646 |
else if ((aSymbolOrInteger == @symbol(stream)) || (aSymbolOrInteger == @symbol(SOCK_STREAM))) |
13891 | 5647 |
typeCode = __mkSmallInteger(SOCK_STREAM); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5648 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5649 |
#ifdef SOCK_DGRAM |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5650 |
else if ((aSymbolOrInteger == @symbol(datagram)) || (aSymbolOrInteger == @symbol(SOCK_DGRAM))) |
13891 | 5651 |
typeCode = __mkSmallInteger(SOCK_DGRAM); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5652 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5653 |
#ifdef SOCK_RAW |
8669 | 5654 |
else if ((aSymbolOrInteger == @symbol(raw)) || (aSymbolOrInteger == @symbol(SOCK_RAW))) |
13891 | 5655 |
typeCode = __mkSmallInteger(SOCK_RAW); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5656 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5657 |
#ifdef SOCK_RDM |
8669 | 5658 |
else if ((aSymbolOrInteger == @symbol(rdm)) || (aSymbolOrInteger == @symbol(SOCK_RDM))) |
13891 | 5659 |
typeCode = __mkSmallInteger(SOCK_RDM); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5660 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5661 |
#ifdef SOCK_SEQPACKET |
8669 | 5662 |
else if ((aSymbolOrInteger == @symbol(seqpacket)) || (aSymbolOrInteger == @symbol(SOCK_SEQPACKET))) |
13891 | 5663 |
typeCode = __mkSmallInteger(SOCK_SEQPACKET); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5664 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5665 |
#ifdef SOCK_PACKET |
8669 | 5666 |
else if ((aSymbolOrInteger == @symbol(packet)) || (aSymbolOrInteger == @symbol(SOCK_PACKET))) |
13891 | 5667 |
typeCode = __mkSmallInteger(SOCK_PACKET); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5668 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5669 |
%}. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5670 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5671 |
^ typeCode. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5672 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5673 |
" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5674 |
self socketTypeCodeOf:#stream |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5675 |
self socketTypeCodeOf:#datagram |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5676 |
self socketTypeCodeOf:#raw |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5677 |
" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5678 |
! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5679 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5680 |
socketTypeSymbolOf:anInteger |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5681 |
"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
|
5682 |
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
|
5683 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5684 |
|socketTypeSymbol| |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5685 |
|
8669 | 5686 |
%{ /*NOCONTEXT*/ |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5687 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5688 |
if (__isSmallInteger(anInteger)) { |
13891 | 5689 |
switch(__intVal(anInteger)) { |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5690 |
#ifdef SOCK_STREAM |
13891 | 5691 |
case SOCK_STREAM: |
5692 |
socketTypeSymbol = @symbol(SOCK_STREAM); |
|
5693 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5694 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5695 |
#ifdef SOCK_DGRAM |
13891 | 5696 |
case SOCK_DGRAM: |
5697 |
socketTypeSymbol = @symbol(SOCK_DGRAM); |
|
5698 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5699 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5700 |
#ifdef SOCK_RAW |
13891 | 5701 |
case SOCK_RAW: |
5702 |
socketTypeSymbol = @symbol(SOCK_RAW); |
|
5703 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5704 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5705 |
#ifdef SOCK_RDM |
13891 | 5706 |
case SOCK_RDM: |
5707 |
socketTypeSymbol = @symbol(SOCK_RDM); |
|
5708 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5709 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5710 |
#ifdef SOCK_SEQPACKET |
13891 | 5711 |
case SOCK_SEQPACKET: |
5712 |
socketTypeSymbol = @symbol(SOCK_SEQPACKET); |
|
5713 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5714 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5715 |
#ifdef SOCK_PACKET |
13891 | 5716 |
case SOCK_PACKET: |
5717 |
socketTypeSymbol = @symbol(SOCK_PACKET); |
|
5718 |
break; |
|
5719 |
#endif |
|
5720 |
} |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5721 |
} |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5722 |
%}. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5723 |
^ socketTypeSymbol. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5724 |
! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5725 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5726 |
supportedProtocolFamilies |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5727 |
"return a collection of supported protocol families. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5728 |
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
|
5729 |
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
|
5730 |
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
|
5731 |
(non-AF-prefixed) symbols; these will vanish." |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5732 |
|
7713 | 5733 |
^ #( |
16499 | 5734 |
#AF_INET |
5735 |
#AF_UNIX |
|
5736 |
#AF_INET6 |
|
5737 |
#AF_APPLETALK |
|
5738 |
#AF_DECnet |
|
5739 |
#AF_NS |
|
5740 |
#AF_X25 |
|
5741 |
#AF_SNA |
|
5742 |
#AF_RAW |
|
5743 |
#AF_ISO |
|
5744 |
#AF_ECMA |
|
5745 |
#AF_NETBIOS |
|
5746 |
#AF_IPX |
|
5747 |
#AF_AX25 |
|
5748 |
#AF_NETROM |
|
5749 |
#AF_BRIDGE |
|
5750 |
#AF_BSC |
|
5751 |
#AF_ROSE |
|
5752 |
#AF_IRDA |
|
5753 |
#AF_NETLINK |
|
5754 |
#AF_NETLINK |
|
5755 |
#AF_NETBEUI |
|
5756 |
#AF_ATM |
|
5757 |
#AF_ATMPVC |
|
5758 |
#AF_ATMSVC |
|
5759 |
#AF_BAN |
|
5760 |
#AF_VOICEVIEW |
|
5761 |
#AF_ECONET |
|
5762 |
#AF_IMPLINK |
|
5763 |
#AF_PUP |
|
5764 |
#AF_CHAOS |
|
5765 |
#AF_DLI |
|
5766 |
#AF_LAT |
|
5767 |
#AF_HYLINK |
|
5768 |
#AF_FIREFOX |
|
5769 |
#AF_CLUSTER |
|
5770 |
#AF_12844 |
|
5771 |
#AF_NETDES |
|
15515
bf6d07fa4da9
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15509
diff
changeset
|
5772 |
) select:[:sym | (AbstractOperatingSystem domainCodeOf:sym) isInteger ] |
8669 | 5773 |
|
5774 |
" |
|
5775 |
AbstractOperatingSystem supportedProtocolFamilies |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5776 |
" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5777 |
! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5778 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5779 |
supportedSocketTypes |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5780 |
"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
|
5781 |
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
|
5782 |
|
7713 | 5783 |
^ #( |
13891 | 5784 |
#SOCK_STREAM |
5785 |
#SOCK_DGRAM |
|
5786 |
#SOCK_RAW |
|
5787 |
#SOCK_RDM |
|
5788 |
#SOCK_SEQPACKET |
|
5789 |
#SOCK_PACKET |
|
8669 | 5790 |
) select:[:sym | (AbstractOperatingSystem socketTypeCodeOf:sym) isNumber ] |
7713 | 5791 |
|
5792 |
" |
|
5793 |
AbstractOperatingSystem supportedSocketTypes |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5794 |
" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5795 |
! ! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5796 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5797 |
!AbstractOperatingSystem class methodsFor:'shared memory access'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5798 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5799 |
shmAttach:id address:addr flags:flags |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5800 |
"low level entry to shmat()-system call. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5801 |
Not supported on all operatingSystems" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5802 |
|
18356
1312e3a2100b
lazy fetch of error signals
Claus Gittinger <cg@exept.de>
parents:
18303
diff
changeset
|
5803 |
^ self unsupportedOperationSignal raise |
4204 | 5804 |
|
5805 |
"Modified: / 19.5.1999 / 14:21:35 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5806 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5807 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5808 |
shmDetach:addr |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5809 |
"low level entry to shmdt()-system call. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5810 |
Not supported on all operatingSystems" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5811 |
|
18356
1312e3a2100b
lazy fetch of error signals
Claus Gittinger <cg@exept.de>
parents:
18303
diff
changeset
|
5812 |
^ self unsupportedOperationSignal raise |
4204 | 5813 |
|
5814 |
"Modified: / 19.5.1999 / 14:21:37 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5815 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5816 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5817 |
shmGet:key size:size flags:flags |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5818 |
"low level entry to shmget()-system call. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5819 |
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
|
5820 |
- use the provided wrapper class SharedExternalBytes instead." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5821 |
|
18356
1312e3a2100b
lazy fetch of error signals
Claus Gittinger <cg@exept.de>
parents:
18303
diff
changeset
|
5822 |
^ self unsupportedOperationSignal raise |
4204 | 5823 |
|
5824 |
"Modified: / 19.5.1999 / 14:21:41 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5825 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5826 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5827 |
!AbstractOperatingSystem class methodsFor:'time and date'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5828 |
|
8565
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5829 |
computeDatePartsOf:osTime for:aBlock |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5830 |
"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
|
5831 |
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
|
5832 |
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
|
5833 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5834 |
<resource:#obsolete> |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5835 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5836 |
|i| |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5837 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5838 |
self obsoleteMethodWarning:'use #computeTimeAndDateFrom:osTime'. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5839 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5840 |
i := self computeTimeAndDateFrom:osTime. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5841 |
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
|
5842 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5843 |
" |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5844 |
OperatingSystem computeDatePartsOf:0 for:[:y :m :d | |
13891 | 5845 |
y printCR. m printCR. d printCR |
8565
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5846 |
] |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5847 |
" |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5848 |
! |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5849 |
|
4377
59bb21ad2839
New method to compute Time form UTC.
Stefan Vogel <sv@exept.de>
parents:
4240
diff
changeset
|
5850 |
computeOSTimeFromUTCYear:y month:m day:d hour:h minute:min second:s millisecond:millis |
8669 | 5851 |
"return the OS-dependent time for the given time and day. |
17006 | 5852 |
The arguments are assumed to be in UTC time." |
5853 |
||
5854 |
^ self |
|
5855 |
computeOSTimeFromYear:y month:m day:d hour:h minute:min second:s millisecond:millis |
|
5856 |
utc:true |
|
5857 |
||
5858 |
" |
|
5859 |
OperatingSystem computeOSTimeFromUTCYear:1970 month:1 day:1 hour:0 minute:0 second:0 millisecond:0 |
|
5860 |
invalid: |
|
5861 |
OperatingSystem computeOSTimeFromUTCYear:1970 month:1 day:1 hour:24 minute:0 second:0 millisecond:0 |
|
5862 |
" |
|
5863 |
||
5864 |
"Modified: / 07-07-2010 / 16:56:21 / cg" |
|
4377
59bb21ad2839
New method to compute Time form UTC.
Stefan Vogel <sv@exept.de>
parents:
4240
diff
changeset
|
5865 |
! |
59bb21ad2839
New method to compute Time form UTC.
Stefan Vogel <sv@exept.de>
parents:
4240
diff
changeset
|
5866 |
|
16948 | 5867 |
computeOSTimeFromYear:y month:m day:d hour:h minute:min second:s millisecond:millis |
8669 | 5868 |
"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
|
5869 |
The arguments are assumed to be in localtime including |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5870 |
any daylight saving adjustings." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5871 |
|
17006 | 5872 |
^ self |
5873 |
computeOSTimeFromYear:y month:m day:d hour:h minute:min second:s millisecond:millis |
|
5874 |
utc:false |
|
5875 |
||
5876 |
" |
|
5877 |
OperatingSystem computeOSTimeFromYear:1970 month:1 day:1 hour:0 minute:0 second:0 millisecond:0 |
|
5878 |
invalid: |
|
5879 |
OperatingSystem computeOSTimeFromYear:1970 month:1 day:1 hour:24 minute:0 second:0 millisecond:0 |
|
5880 |
" |
|
5881 |
||
5882 |
"Modified: / 07-07-2010 / 16:56:21 / cg" |
|
5883 |
! |
|
5884 |
||
5885 |
computeOSTimeFromYear:y month:m day:d hour:h minute:min second:s millisecond:millis utc:utcBoolean |
|
5886 |
"return the OS-dependent time for the given time and day. |
|
5887 |
If utcBoolean is true, the arguments are assumed to be in UTC Time; |
|
5888 |
otherwise in localtime including any daylight saving adjustings." |
|
5889 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5890 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5891 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5892 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5893 |
computeTimeAndDateFrom:osTime |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5894 |
"given an OS-dependent time in osTime, return an Array |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5895 |
containing (full-) year, month, day, hour, minute and seconds, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5896 |
offset to UTC, daylight savings time flag, milliseconds, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5897 |
dayInYear (1..) and dayInWeek (1..). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5898 |
Conversion is to localtime including any daylight saving adjustments." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5899 |
|
17030
699aeda3a948
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17027
diff
changeset
|
5900 |
^ self timeInfoFromSeconds:(osTime // 1000) milliseconds:(osTime \\ 1000) localTime:true. |
7514 | 5901 |
|
5902 |
" |
|
5903 |
OperatingSystem computeTimeAndDateFrom:0 |
|
5904 |
OperatingSystem computeTimeAndDateFrom:1011 |
|
5905 |
" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5906 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5907 |
|
8565
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5908 |
computeTimePartsOf:osTime for:aBlock |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5909 |
"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
|
5910 |
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
|
5911 |
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
|
5912 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5913 |
<resource:#obsolete> |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5914 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5915 |
|hours minutes seconds millis i| |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5916 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5917 |
self obsoleteMethodWarning:'use #computeTimeAndDateFrom:osTime'. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5918 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5919 |
i := self computeTimeAndDateFrom:osTime. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5920 |
hours := i hours. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5921 |
minutes := i minutes. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5922 |
seconds := i seconds. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5923 |
millis := i milliseconds. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5924 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5925 |
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
|
5926 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5927 |
" |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5928 |
OperatingSystem computeTimePartsOf:100 for:[:h :m :s :milli | |
13891 | 5929 |
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
|
5930 |
] |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5931 |
" |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5932 |
! |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5933 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5934 |
computeUTCTimeAndDateFrom:osTime |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5935 |
"given an OS-dependent time in osTime, return an Array |
7514 | 5936 |
containing: |
17637 | 5937 |
(full-) year, |
5938 |
month, (1..) |
|
5939 |
day, (1..) |
|
5940 |
hour, (0..23) |
|
5941 |
minute (0..59) |
|
5942 |
seconds, (0..59) |
|
5943 |
offset to UTC, (seconds) |
|
5944 |
daylight savings time flag, |
|
5945 |
milliseconds, (0..999) |
|
5946 |
dayInYear (1..) |
|
5947 |
dayInWeek (1..). |
|
7514 | 5948 |
Conversion is to utc." |
5949 |
||
17030
699aeda3a948
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17027
diff
changeset
|
5950 |
^ self timeInfoFromSeconds:(osTime // 1000) milliseconds:(osTime \\ 1000) localTime:false. |
7514 | 5951 |
|
5952 |
" |
|
8669 | 5953 |
OperatingSystem computeUTCTimeAndDateFrom:0 |
7514 | 5954 |
OperatingSystem computeUTCTimeAndDateFrom:1011 |
5955 |
" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5956 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5957 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5958 |
computeUTCTimePartsOf:osTime for:aBlock |
8565
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5959 |
"compute hours, minutes, seconds and milliseconds from the osTime |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5960 |
and evaluate the argument, a 4-arg block with these. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5961 |
Conversion is to UTC." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5962 |
|
8565
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5963 |
<resource:#obsolete> |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5964 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5965 |
|hours minutes seconds millis i| |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5966 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5967 |
self obsoleteMethodWarning:'use #computeTimeAndDateFrom:osTime'. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5968 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5969 |
i := self computeUTCTimeAndDateFrom:osTime. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5970 |
hours := i hours. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5971 |
minutes := i minutes. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5972 |
seconds := i seconds. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5973 |
millis := i milliseconds. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5974 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5975 |
aBlock value:hours value:minutes value:seconds value:millis |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5976 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5977 |
|
17010
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
5978 |
epochEndOSTime |
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
5979 |
"private interface for timestamp to ask the OS what the maximum time |
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
5980 |
(in milliseconds since the Unix epoch, 1.1.1970) is. |
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
5981 |
Unix systems will return 0x7FFFFFFF here; other OS's may return a higher number to indicate, |
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
5982 |
that they can deal with timestamps after 2038 (especially: win32 will do so). |
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
5983 |
Notice that timestamp is prepared to compensate for any OS limitation by computing the timeInfo |
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
5984 |
components itself. |
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
5985 |
So it is usually (except for a little performane) no problem to return a reange too small here." |
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
5986 |
|
17012
4dc74652cfb6
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17010
diff
changeset
|
5987 |
^ 16r7FFFFFFF * 1000 |
17010
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
5988 |
! |
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
5989 |
|
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
5990 |
epochStartOSTime |
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
5991 |
"private interface for timestamp to ask the OS what the minimum time |
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
5992 |
(in milliseconds since the Unix epoch, 1.1.1970) is. |
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
5993 |
Unix systems will return 0 here; other OS's may return a negative number to indicate, |
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
5994 |
that they can deal with timestamps before 1970 (especially: win32 will do so). |
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
5995 |
Notice that timestamp is prepared to compensate for any OS limitation by computing the timeInfo |
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
5996 |
components itself. |
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
5997 |
So it is usually (except for a little performane) no problem to return a reange too small here." |
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
5998 |
|
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
5999 |
^ 0 |
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
6000 |
! |
3ba8113e26c3
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17006
diff
changeset
|
6001 |
|
13890 | 6002 |
getCPUCycleCount |
6003 |
"get a CPU specific cycle counter value. |
|
6004 |
Can be used for exact timing & performance measurements. |
|
6005 |
Notice, that the # of cycles has to be multiplied by the cycle time (1/cpu-frequency). |
|
6006 |
||
6007 |
For x86: |
|
16499 | 6008 |
the CPU cycle count register value is returned (RDTSC instruction). |
6009 |
Fails if RDTSC instruction is not supported (which is unlikely, nowadays). |
|
13890 | 6010 |
For others: |
16499 | 6011 |
currently fails" |
13890 | 6012 |
|
6013 |
%{ /* NOCONTEXT */ |
|
14937
808947598c5b
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14846
diff
changeset
|
6014 |
unsigned INT low, high; |
13890 | 6015 |
|
18229 | 6016 |
#ifdef __x86_64__ |
6017 |
# if defined(__GCC__) |
|
6018 |
asm volatile("rdtsc" : "=a"(low), "=d"(high)); |
|
6019 |
RETURN ( __MKUINT(low + (high << 32)) ); |
|
6020 |
# endif |
|
6021 |
#endif |
|
6022 |
||
13890 | 6023 |
#ifdef i386 |
6024 |
// use RDTSC instruction (retrieves 64bit cycle count; hi in EDX, lo in EAX) |
|
6025 |
||
6026 |
# if defined(__BORLANDC__) |
|
6027 |
_asm { push edx }; |
|
6028 |
__emit__(0x0F,0x31); /* RDTSC instruction */ |
|
13891 | 6029 |
_asm { mov low,eax }; |
13890 | 6030 |
_asm { mov high,edx }; |
6031 |
_asm { pop edx }; |
|
18229 | 6032 |
# else |
6033 |
# if defined(__MINGW_H) || defined(__GNUC__) |
|
13890 | 6034 |
asm volatile("rdtsc" : "=a"(low), "=d"(high)); |
18229 | 6035 |
# else |
13890 | 6036 |
goto unsupported; |
18229 | 6037 |
# endif |
13890 | 6038 |
# endif |
14937
808947598c5b
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14846
diff
changeset
|
6039 |
RETURN ( __MKLARGEINT64(1, low, high) ); |
13890 | 6040 |
#endif /* i386 */ |
6041 |
||
6042 |
unsupported: ; |
|
6043 |
%}. |
|
6044 |
self primitiveFailed:'no CPU cycle register on this architecture' |
|
6045 |
||
14937
808947598c5b
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14846
diff
changeset
|
6046 |
" |
808947598c5b
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14846
diff
changeset
|
6047 |
OperatingSystem getCPUCycleCount |
808947598c5b
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14846
diff
changeset
|
6048 |
" |
808947598c5b
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14846
diff
changeset
|
6049 |
|
13890 | 6050 |
"Created: / 05-01-2012 / 13:23:31 / cg" |
6051 |
! |
|
6052 |
||
3689
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
6053 |
getMicrosecondTime |
8669 | 6054 |
"This returns the microsecond timers value - if available. |
3689
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
6055 |
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
|
6056 |
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
|
6057 |
clock resolution value." |
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
6058 |
|
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
6059 |
"/ fallBack - use getMillisecondTime, which must be implemented |
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
6060 |
"/ for all OS's |
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
6061 |
|
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
6062 |
^ self getMillisecondTime * 1000 |
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
6063 |
|
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
6064 |
"Created: / 30.7.1998 / 16:38:26 / cg" |
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
6065 |
! |
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
6066 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6067 |
getMillisecondTime |
8669 | 6068 |
"This returns the millisecond timers value. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6069 |
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
|
6070 |
LargeInteger arithmetic when doing timeouts and delays. |
8669 | 6071 |
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
|
6072 |
short relative time deltas. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6073 |
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
|
6074 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6075 |
BAD DESIGN: |
13891 | 6076 |
This should be changed to return some instance of RelativeTime, |
6077 |
and these computations moved there. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6078 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6079 |
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
|
6080 |
interface. For compatibility with ST-80, use Time millisecondClockValue. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6081 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6082 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6083 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6084 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6085 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6086 |
getOSTime |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6087 |
"This returns the OS time. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6088 |
The base of the returned value is not consistent across |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6089 |
different OS's - some return the number of millis since jan, 1st 1970; |
8669 | 6090 |
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
|
6091 |
converts as appropriate (by using my fromOSTime: conversion methods). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6092 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6093 |
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
|
6094 |
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
|
6095 |
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
|
6096 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6097 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6098 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6099 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6100 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6101 |
maximumMillisecondTimeDelta |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6102 |
"this returns the maximum delta supported by millisecondCounter |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6103 |
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
|
6104 |
timer wraps." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6105 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6106 |
%{ /* NOCONTEXT */ |
8913 | 6107 |
RETURN ( __mkSmallInteger(0x0FFFFFFF) ); |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6108 |
%} |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6109 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6110 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6111 |
millisecondDelay:millis |
7681
7c63f0b47f0d
oops: millisecondDelay: was duplicated
Claus Gittinger <cg@exept.de>
parents:
7656
diff
changeset
|
6112 |
"delay execution for millis milliseconds or until the next event arrives. |
8669 | 6113 |
All other threads proceed as usual. |
7849 | 6114 |
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
|
6115 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6116 |
|now then delta| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6117 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6118 |
now := self getMillisecondTime. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6119 |
then := self millisecondTimeAdd:now and:millis. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6120 |
|
11163
be8400d459aa
#milliSecondsTimeDeltaBetween:and:
Stefan Vogel <sv@exept.de>
parents:
10734
diff
changeset
|
6121 |
[(delta := self millisecondTimeDeltaBetween:then and:now) > 0] whileTrue:[ |
16499 | 6122 |
self |
6123 |
selectOnAnyReadable:nil writable:nil exception:nil |
|
6124 |
readableInto:nil writableInto:nil exceptionInto:nil |
|
6125 |
withTimeOut:delta. |
|
6126 |
now := self getMillisecondTime. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6127 |
] |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6128 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6129 |
" |
7849 | 6130 |
OperatingSystem millisecondDelay:5000 |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6131 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6132 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6133 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6134 |
millisecondTime:msTime1 isAfter:msTime2 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6135 |
"return true if msTime1 is after msTime2, false if not. |
8669 | 6136 |
The two arguments are supposed to be millisecond times |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6137 |
(such as returned getMillisecondTime) which wrap at 16r1FFFFFFF. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6138 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6139 |
This should really be moved to some RelativeTime class." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6140 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6141 |
(msTime1 > msTime2) ifTrue:[ |
13891 | 6142 |
((msTime1 - msTime2) < 16r10000000) ifTrue:[ |
6143 |
^ true |
|
6144 |
]. |
|
11163
be8400d459aa
#milliSecondsTimeDeltaBetween:and:
Stefan Vogel <sv@exept.de>
parents:
10734
diff
changeset
|
6145 |
] ifFalse:[ |
13891 | 6146 |
((msTime2 - msTime1) > 16r10000000) ifTrue:[ |
6147 |
^ true |
|
6148 |
]. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6149 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6150 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6151 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6152 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6153 |
millisecondTimeAdd:msTime1 and:msTime2 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6154 |
"Add two millisecond times (such as returned getMillisecondTime). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6155 |
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
|
6156 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6157 |
This should really be moved to some RelativeTime class." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6158 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6159 |
|sum| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6160 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6161 |
sum := msTime1 + msTime2. |
13799
cf5e4ece609b
changed: #millisecondTimeAdd:and:
Stefan Vogel <sv@exept.de>
parents:
13557
diff
changeset
|
6162 |
(sum > 16r1FFFFFFF) ifTrue:[ |
13891 | 6163 |
self assert:(sum <= 16r3FFFFFFF) message:'overflow in timer computation'. |
6164 |
^ sum - 16r20000000. |
|
13799
cf5e4ece609b
changed: #millisecondTimeAdd:and:
Stefan Vogel <sv@exept.de>
parents:
13557
diff
changeset
|
6165 |
]. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6166 |
(sum < 0) ifTrue:[^ sum + 16r20000000]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6167 |
^ sum |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6168 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6169 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6170 |
millisecondTimeDeltaBetween:msTime1 and:msTime2 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6171 |
"subtract two millisecond times (such as returned getMillisecondTime) |
8669 | 6172 |
and return the difference. Since milli-times wrap (at 16r01FFFFFFF), |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6173 |
some special handling is built-in here. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6174 |
The returned value is msTime1 - msTime2. The returned value is invalid |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6175 |
if the delta is >= 0x10000000. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6176 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6177 |
This should really be moved to some RelativeTime class; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6178 |
better yet: create a subclass of Integer named LimitedRangeInteger." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6179 |
|
11163
be8400d459aa
#milliSecondsTimeDeltaBetween:and:
Stefan Vogel <sv@exept.de>
parents:
10734
diff
changeset
|
6180 |
|diff| |
be8400d459aa
#milliSecondsTimeDeltaBetween:and:
Stefan Vogel <sv@exept.de>
parents:
10734
diff
changeset
|
6181 |
|
be8400d459aa
#milliSecondsTimeDeltaBetween:and:
Stefan Vogel <sv@exept.de>
parents:
10734
diff
changeset
|
6182 |
diff := msTime1 - msTime2. |
11166
52c2ccfc0d4c
Make last change better looking
Stefan Vogel <sv@exept.de>
parents:
11165
diff
changeset
|
6183 |
diff > 16r-10000000 ifTrue:[ |
13891 | 6184 |
(diff < 16r10000000) ifTrue:[ |
6185 |
^ diff. |
|
6186 |
] ifFalse:[ |
|
6187 |
^ diff - 16r20000000. |
|
6188 |
]. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6189 |
]. |
11163
be8400d459aa
#milliSecondsTimeDeltaBetween:and:
Stefan Vogel <sv@exept.de>
parents:
10734
diff
changeset
|
6190 |
^ diff + 16r20000000 |
be8400d459aa
#milliSecondsTimeDeltaBetween:and:
Stefan Vogel <sv@exept.de>
parents:
10734
diff
changeset
|
6191 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6192 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6193 |
" |
8669 | 6194 |
OperatingSystem millisecondTimeAdd:16r0FFFFFFF and:1 |
6195 |
OperatingSystem millisecondTimeAdd:16r0FFFFFFF and:(16 / 3) |
|
6196 |
OperatingSystem millisecondTimeAdd:16r0FFFFFFF and:1000 |
|
6197 |
||
6198 |
OperatingSystem millisecondTimeDeltaBetween:0 and:16r0FFFFFFF |
|
11163
be8400d459aa
#milliSecondsTimeDeltaBetween:and:
Stefan Vogel <sv@exept.de>
parents:
10734
diff
changeset
|
6199 |
OperatingSystem millisecondTimeDeltaBetween:0 and:16r1FFFFFFF |
be8400d459aa
#milliSecondsTimeDeltaBetween:and:
Stefan Vogel <sv@exept.de>
parents:
10734
diff
changeset
|
6200 |
OperatingSystem millisecondTimeDeltaBetween:16r1FFFFFFF and:0 |
be8400d459aa
#milliSecondsTimeDeltaBetween:and:
Stefan Vogel <sv@exept.de>
parents:
10734
diff
changeset
|
6201 |
|
8669 | 6202 |
OperatingSystem millisecondTimeDeltaBetween:(13/3) and:16r0FFFFFFF |
6203 |
OperatingSystem millisecondTimeDeltaBetween:999 and:16r0FFFFFFF |
|
6204 |
||
6205 |
OperatingSystem millisecondTime:0 isAfter:16r0FFFFFFF |
|
11163
be8400d459aa
#milliSecondsTimeDeltaBetween:and:
Stefan Vogel <sv@exept.de>
parents:
10734
diff
changeset
|
6206 |
OperatingSystem millisecondTime:0 isAfter:16r1FFFFFFF |
8669 | 6207 |
OperatingSystem millisecondTime:(13/3) isAfter:16r0FFFFFFF |
6208 |
OperatingSystem millisecondTime:999 isAfter:16r0FFFFFFF |
|
6209 |
||
6210 |
OperatingSystem millisecondTime:0 isAfter:0 |
|
6211 |
OperatingSystem millisecondTime:(13/3) isAfter:0 |
|
6212 |
OperatingSystem millisecondTime:999 isAfter:0 |
|
6213 |
||
6214 |
OperatingSystem millisecondTime:1 isAfter:0 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6215 |
OperatingSystem millisecondTime:(13/3) isAfter:2 |
8669 | 6216 |
OperatingSystem millisecondTime:999 isAfter:900 |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6217 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6218 |
|t1 t2| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6219 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6220 |
t1 := Time millisecondClockValue. |
8669 | 6221 |
(Delay forMilliseconds:1) wait. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6222 |
t2 := Time millisecondClockValue. |
8669 | 6223 |
OperatingSystem millisecondTimeDeltaBetween:t2 and:t1 |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6224 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6225 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6226 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6227 |
sleep:numberOfSeconds |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6228 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6229 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6230 |
"cease ANY action for some time. This suspends the whole smalltalk |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6231 |
(unix-) process for some time. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6232 |
Not really useful since not even low-prio processes and interrupt |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6233 |
handling will run during the sleep. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6234 |
Use either OperatingSystem>>millisecondDelay: (which makes all |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6235 |
threads sleep, but handles interrupts) or use a Delay (which makes |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6236 |
only the calling thread sleep)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6237 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6238 |
self subclassResponsibility |
7514 | 6239 |
! |
6240 |
||
6241 |
timeInfoClass |
|
6242 |
^ TimeInfo |
|
6243 |
! |
|
6244 |
||
17018
9c06231f0d1c
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17017
diff
changeset
|
6245 |
timeInfoFromSeconds:osSeconds localTime:isLocalTime |
9c06231f0d1c
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17017
diff
changeset
|
6246 |
"return a timeInfo structure containing values for the given OS-second value. |
9c06231f0d1c
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17017
diff
changeset
|
6247 |
An internal helper" |
9c06231f0d1c
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17017
diff
changeset
|
6248 |
|
9c06231f0d1c
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17017
diff
changeset
|
6249 |
^ self timeInfoFromSeconds:osSeconds milliseconds:0 localTime:isLocalTime |
9c06231f0d1c
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17017
diff
changeset
|
6250 |
! |
9c06231f0d1c
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17017
diff
changeset
|
6251 |
|
7739
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6252 |
timeInfoFromSeconds:osSeconds milliseconds:osMilliSeconds localTime:isLocalTime |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6253 |
"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
|
6254 |
An internal helper" |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6255 |
|
7514 | 6256 |
self subclassResponsibility |
17017
f6a1e6eb666e
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17013
diff
changeset
|
6257 |
! |
f6a1e6eb666e
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17013
diff
changeset
|
6258 |
|
17170
280139d863b5
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17150
diff
changeset
|
6259 |
timeZoneInfoClass |
280139d863b5
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17150
diff
changeset
|
6260 |
^ TimeZoneInfo |
280139d863b5
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17150
diff
changeset
|
6261 |
! |
280139d863b5
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17150
diff
changeset
|
6262 |
|
17017
f6a1e6eb666e
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17013
diff
changeset
|
6263 |
utcOffset |
f6a1e6eb666e
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17013
diff
changeset
|
6264 |
^ (self computeTimeAndDateFrom:0) utcOffset |
f6a1e6eb666e
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17013
diff
changeset
|
6265 |
|
f6a1e6eb666e
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17013
diff
changeset
|
6266 |
" |
17637 | 6267 |
OperatingSystem utcOffset |
17017
f6a1e6eb666e
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
17013
diff
changeset
|
6268 |
" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6269 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6270 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6271 |
!AbstractOperatingSystem class methodsFor:'users & groups'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6272 |
|
12971 | 6273 |
getApplicationDataDirectoryFor:appName |
6274 |
"return the directory, where user-and-application-specific private files are to be |
|
6275 |
located (ini-files, preferences etc.). |
|
6276 |
Under windows, something like 'C:\Users\Administrator\AppData\Roaming\<appName>' |
|
6277 |
is returned, here, the fallback ~/.<appName> is returned. |
|
6278 |
Notice that only the name is returned; the directory is not guaranteed to exist." |
|
6279 |
||
6280 |
"{ Pragma: +optSpace }" |
|
6281 |
||
6282 |
^ self getHomeDirectory asFilename constructString:('.',appName) |
|
6283 |
||
6284 |
" |
|
13891 | 6285 |
OperatingSystem getApplicationDataDirectoryFor:'expecco' |
12971 | 6286 |
" |
6287 |
||
6288 |
"Created: / 29-07-2010 / 12:07:25 / sr" |
|
6289 |
! |
|
6290 |
||
10544 | 6291 |
getDesktopDirectory |
6292 |
"{ Pragma: +optSpace }" |
|
6293 |
||
15772
90d541e96217
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
15762
diff
changeset
|
6294 |
"return the name of the user's desktop directory. |
90d541e96217
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
15762
diff
changeset
|
6295 |
The fallback here returns the user's home directory." |
10544 | 6296 |
|
10545 | 6297 |
^ self getHomeDirectory |
6298 |
||
6299 |
" |
|
13891 | 6300 |
OperatingSystem getDesktopDirectory |
10544 | 6301 |
" |
6302 |
||
6303 |
"Created: / 16-05-2007 / 13:20:53 / cg" |
|
6304 |
! |
|
6305 |
||
11760 | 6306 |
getDocumentsDirectory |
6307 |
"return your documents directory. |
|
6308 |
Under windows, thats the real 'Documents' or 'My Documents'. |
|
6309 |
The fallback here returns the users home directory." |
|
6310 |
||
6311 |
"{ Pragma: +optSpace }" |
|
6312 |
||
6313 |
^ self getHomeDirectory |
|
6314 |
||
6315 |
" |
|
13891 | 6316 |
OperatingSystem getDocumentsDirectory |
11760 | 6317 |
" |
6318 |
! |
|
6319 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6320 |
getEffectiveGroupID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6321 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6322 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6323 |
"return the current users (thats you) effective numeric group id. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6324 |
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
|
6325 |
as a setuid program (of which you should think about twice)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6326 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6327 |
^ self getGroupID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6328 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6329 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6330 |
OperatingSystem getEffectiveGroupID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6331 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6332 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6333 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6334 |
getEffectiveUserID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6335 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6336 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6337 |
"return the current users (thats you) effective numeric user id. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6338 |
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
|
6339 |
as a setuid program (of which you should think about twice)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6340 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6341 |
^ self getUserID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6342 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6343 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6344 |
OperatingSystem getEffectiveUserID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6345 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6346 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6347 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6348 |
getFullUserName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6349 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6350 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6351 |
"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
|
6352 |
If not, return the login name as a fallBack." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6353 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6354 |
^ self getFullUserNameFromID:(self getUserID) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6355 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6356 |
" |
8669 | 6357 |
OperatingSystem getFullUserName |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6358 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6359 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6360 |
"Modified: 24.1.1997 / 11:31:55 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6361 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6362 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6363 |
getFullUserNameFromID:userID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6364 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6365 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6366 |
"return a string with the users full name - if available. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6367 |
If not, return the login name as a fallBack." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6368 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6369 |
^ self getUserNameFromID:userID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6370 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6371 |
" |
8669 | 6372 |
OperatingSystem getFullUserNameFromID:0 |
6373 |
OperatingSystem getFullUserNameFromID:(OperatingSystem getUserID) |
|
6374 |
||
6375 |
OperatingSystem getUserNameFromID:(OperatingSystem getUserID) |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6376 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6377 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6378 |
"Modified: 15.7.1996 / 12:44:21 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6379 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6380 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6381 |
getGroupID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6382 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6383 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6384 |
"return the current users (thats you) numeric group id" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6385 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6386 |
^ 1 "/ just a dummy for systems which do not have userIDs |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6387 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6388 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6389 |
OperatingSystem getGroupID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6390 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6391 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6392 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6393 |
getGroupNameFromID:aNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6394 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6395 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6396 |
"return the group-name-string for a given numeric group-id" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6397 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6398 |
^ '???' "/ just a dummy for systems which do not have groups |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6399 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6400 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6401 |
OperatingSystem getGroupNameFromID:0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6402 |
OperatingSystem getGroupNameFromID:10 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6403 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6404 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6405 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6406 |
getHomeDirectory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6407 |
"return the name of the users home directory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6408 |
(i.e. yours)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6409 |
|
11760 | 6410 |
^ self subclassResponsibility |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6411 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6412 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6413 |
OperatingSystem getHomeDirectory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6414 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6415 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6416 |
"Modified: 24.1.1997 / 11:32:13 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6417 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6418 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6419 |
getLoginName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6420 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6421 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6422 |
"return a string with the users login name (thats yours)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6423 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6424 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6425 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6426 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6427 |
getUserID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6428 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6429 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6430 |
"return the current users (thats you) numeric user id" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6431 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6432 |
^ 1 "just a dummy for systems which do not have userIDs" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6433 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6434 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6435 |
OperatingSystem getUserID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6436 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6437 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6438 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6439 |
getUserNameFromID:aNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6440 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6441 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6442 |
"return the user-name-string for a given numeric user-id. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6443 |
This is the login name, not the fullName." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6444 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6445 |
"/ fallBack dummy |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6446 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6447 |
aNumber == self getUserID ifTrue:[ |
13891 | 6448 |
^ self getLoginName |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6449 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6450 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6451 |
^ '? (' , aNumber printString , ')' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6452 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6453 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6454 |
OperatingSystem getUserNameFromID:0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6455 |
OperatingSystem getUserNameFromID:100 |
8669 | 6456 |
OperatingSystem getUserNameFromID:9991 |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6457 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6458 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6459 |
|
15876
55c9a8fefcc8
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
15831
diff
changeset
|
6460 |
isRunningWithElevatedRootOrAdminRights |
55c9a8fefcc8
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
15831
diff
changeset
|
6461 |
^ false "/ actually: don't know |
55c9a8fefcc8
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
15831
diff
changeset
|
6462 |
! |
55c9a8fefcc8
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
15831
diff
changeset
|
6463 |
|
15831
8a298cdf3fc2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
15780
diff
changeset
|
6464 |
isRunningWithRootOrAdminRights |
8a298cdf3fc2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
15780
diff
changeset
|
6465 |
^ false "/ actually: don't know |
8a298cdf3fc2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
15780
diff
changeset
|
6466 |
! |
8a298cdf3fc2
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
15780
diff
changeset
|
6467 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6468 |
userInfoOf:aNameOrID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6469 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6470 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6471 |
"return a dictionary filled with userinfo. The argument can be either |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6472 |
a string with the users name or its numeric id. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6473 |
Notice, that not all systems provide (all of) this info; |
8669 | 6474 |
DOS systems return nothing; |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6475 |
non-SYSV4 systems have no age/comment. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6476 |
Portable applications may want to check the systemType and NOT depend |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6477 |
on all keys to be present in the returned dictionary. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6478 |
Another notice: on some systems (SYSV4), the gecos field includes multiple |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6479 |
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
|
6480 |
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
|
6481 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6482 |
|info| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6483 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6484 |
"/ fallBack dummy |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6485 |
info := IdentityDictionary new. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6486 |
info at:#name put:(self getLoginName). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6487 |
info at:#dir put:(self getHomeDirectory). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6488 |
^ info |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6489 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6490 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6491 |
OperatingSystem userInfoOf:'root' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6492 |
OperatingSystem userInfoOf:1 |
8669 | 6493 |
OperatingSystem userInfoOf:'claus' |
6494 |
OperatingSystem userInfoOf:'fooBar' |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6495 |
OperatingSystem userInfoOf:(OperatingSystem getUserID) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6496 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6497 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6498 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6499 |
!AbstractOperatingSystem class methodsFor:'waiting for events'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6500 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6501 |
blockingChildProcessWait |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6502 |
"return true, if childProcessWait: blocks, if no children are ready. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6503 |
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
|
6504 |
a subprocesses status (to avoid blocking)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6505 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6506 |
^ true |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6507 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6508 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6509 |
childProcessWait:blocking pid:pidToWait |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6510 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6511 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6512 |
"get status changes from child processes. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6513 |
Return an OSProcessStatus or nil, if no process has terminated. |
8669 | 6514 |
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
|
6515 |
otherwise we return immediately. |
8669 | 6516 |
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
|
6517 |
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
|
6518 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6519 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6520 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6521 |
|
7802 | 6522 |
isBlockingOn:fd |
6523 |
"{ Pragma: +optSpace }" |
|
6524 |
||
6525 |
"return the blocking attribute - if set (which is the default) |
|
6526 |
a read on the fileDescriptor will block until data is available. |
|
6527 |
If clear, a read operation will immediately return with a value nil. |
|
6528 |
Also affects write operations, which may perform partial writes when |
|
6529 |
blocking is off" |
|
6530 |
||
6531 |
self subclassResponsibility |
|
6532 |
! |
|
6533 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6534 |
numAvailableForReadOn:fd |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6535 |
"return the number of bytes available for reading, without blocking." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6536 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6537 |
"/ fallBack for systems which do not provide this info |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6538 |
^ (self readCheck:fd) ifTrue:[1] ifFalse:[0] |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6539 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6540 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6541 |
readCheck:fd |
11835
bf65bdad3827
Avoid blocking in PipeStream (e.g. when doing a CVS checkin)
Stefan Vogel <sv@exept.de>
parents:
11834
diff
changeset
|
6542 |
"return true, if a read is possible without blocking. |
13891 | 6543 |
This is the case if data is available on a filedescriptor |
11835
bf65bdad3827
Avoid blocking in PipeStream (e.g. when doing a CVS checkin)
Stefan Vogel <sv@exept.de>
parents:
11834
diff
changeset
|
6544 |
or the read would return an error. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6545 |
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
|
6546 |
|
11834
48e189a9cc53
fix #readCheck: for windows - answer true if filedescriptor is closed
Stefan Vogel <sv@exept.de>
parents:
11768
diff
changeset
|
6547 |
|result| |
48e189a9cc53
fix #readCheck: for windows - answer true if filedescriptor is closed
Stefan Vogel <sv@exept.de>
parents:
11768
diff
changeset
|
6548 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6549 |
self supportsSelect ifFalse:[ |
16499 | 6550 |
"/ mhmh - what should we do then ? |
6551 |
"/ For now, return true as if data was present, |
|
6552 |
"/ and let the thread fall into the read. |
|
6553 |
"/ It will then (hopefully) be descheduled there and |
|
6554 |
"/ effectively polling for input. |
|
6555 |
||
6556 |
^ true |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6557 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6558 |
|
16499 | 6559 |
result := self |
6560 |
selectOnAnyReadable:(Array with:fd) writable:nil exception:nil |
|
6561 |
readableInto:nil writableInto:nil exceptionInto:nil |
|
6562 |
withTimeOut:0. |
|
11834
48e189a9cc53
fix #readCheck: for windows - answer true if filedescriptor is closed
Stefan Vogel <sv@exept.de>
parents:
11768
diff
changeset
|
6563 |
|
48e189a9cc53
fix #readCheck: for windows - answer true if filedescriptor is closed
Stefan Vogel <sv@exept.de>
parents:
11768
diff
changeset
|
6564 |
"on select error, a read will immediately return, so answer true" |
16412
1a090dd6d7fc
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16395
diff
changeset
|
6565 |
^ result ~~ 0. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6566 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6567 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6568 |
readWriteCheck:fd |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6569 |
"return true, if filedescriptor can be read or written without blocking. |
13891 | 6570 |
This is the case if data is available on a filedescriptor |
11835
bf65bdad3827
Avoid blocking in PipeStream (e.g. when doing a CVS checkin)
Stefan Vogel <sv@exept.de>
parents:
11834
diff
changeset
|
6571 |
or the read or write would return an error. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6572 |
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
|
6573 |
be finished." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6574 |
|
16316
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6575 |
|result fdArray| |
11835
bf65bdad3827
Avoid blocking in PipeStream (e.g. when doing a CVS checkin)
Stefan Vogel <sv@exept.de>
parents:
11834
diff
changeset
|
6576 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6577 |
self supportsSelect ifFalse:[ |
16499 | 6578 |
"/ mhmh - what should we do then ? |
6579 |
"/ For now, return true as if data was present, |
|
6580 |
"/ and let the thread fall into the write. |
|
6581 |
"/ It will then (hopefully) be desceduled there and |
|
6582 |
"/ effectively polling for output. |
|
6583 |
^ true |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6584 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6585 |
|
16499 | 6586 |
result := self |
6587 |
selectOnAnyReadable:(fdArray := Array with:fd) writable:fdArray exception:nil |
|
6588 |
readableInto:nil writableInto:nil exceptionInto:nil |
|
6589 |
withTimeOut:0. |
|
16316
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6590 |
|
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6591 |
"on select error, a read will immediately return, so answer true" |
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6592 |
^ result > 0. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6593 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6594 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6595 |
selectOn:fd1 and:fd2 withTimeOut:millis |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6596 |
"wait for any fd to become ready; timeout after t milliseconds. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6597 |
A zero timeout-time will immediately return (i.e. poll). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6598 |
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
|
6599 |
Obsolete: |
16499 | 6600 |
This is a leftover method and will vanish." |
16316
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6601 |
<resource: #obsolete> |
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6602 |
|
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6603 |
|fdArray| |
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6604 |
|
16499 | 6605 |
^ (self |
6606 |
selectOnAnyReadable:(fdArray := Array with:fd1 with:fd2) writable:fdArray exception:nil |
|
6607 |
readableInto:nil writableInto:nil exceptionInto:nil |
|
6608 |
withTimeOut:millis) > 0. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6609 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6610 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6611 |
selectOn:fd withTimeOut:millis |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6612 |
"wait for aFileDesriptor to become ready; timeout after t milliseconds. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6613 |
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
|
6614 |
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
|
6615 |
of read-data. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6616 |
Experimental." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6617 |
|
16316
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6618 |
|fdArray| |
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6619 |
|
16499 | 6620 |
^ (self |
6621 |
selectOnAnyReadable:(fdArray := Array with:fd) writable:fdArray exception:nil |
|
6622 |
readableInto:nil writableInto:nil exceptionInto:nil |
|
6623 |
withTimeOut:millis) > 0. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6624 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6625 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6626 |
selectOnAny:fdArray withTimeOut:millis |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6627 |
"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
|
6628 |
timeout after t milliseconds. An empty set will always wait. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6629 |
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
|
6630 |
Experimental." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6631 |
|
16316
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6632 |
|resultFdArray nReady| |
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6633 |
|
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6634 |
resultFdArray := Array new:1. "/ I am only interested in the first fd |
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6635 |
|
16499 | 6636 |
nReady := self |
6637 |
selectOnAnyReadable:fdArray writable:fdArray exception:nil |
|
6638 |
readableInto:resultFdArray writableInto:resultFdArray exceptionInto:nil |
|
6639 |
withTimeOut:millis. |
|
16316
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6640 |
nReady > 0 ifTrue:[ |
16499 | 6641 |
^ resultFdArray first. |
16316
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6642 |
]. |
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6643 |
|
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6644 |
^ nil |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6645 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6646 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6647 |
selectOnAnyReadable:fdArray withTimeOut:millis |
8669 | 6648 |
"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
|
6649 |
reading. Timeout after t milliseconds. An empty set will always wait. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6650 |
A zero timeout-time will immediately return (i.e. poll). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6651 |
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
|
6652 |
Experimental." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6653 |
|
16316
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6654 |
|resultFdArray nReady| |
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6655 |
|
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6656 |
resultFdArray := Array new:1. "/ I am only interested in the first fd |
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6657 |
|
16499 | 6658 |
nReady := self |
6659 |
selectOnAnyReadable:fdArray writable:nil exception:nil |
|
6660 |
readableInto:resultFdArray writableInto:nil exceptionInto:nil |
|
6661 |
withTimeOut:millis. |
|
16316
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6662 |
nReady > 0 ifTrue:[ |
16499 | 6663 |
^ resultFdArray first. |
16316
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6664 |
]. |
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6665 |
|
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6666 |
^ nil |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6667 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6668 |
|
8669 | 6669 |
selectOnAnyReadable:readFdArray writable:writeFdArray exception:exceptFdArray |
13891 | 6670 |
readableInto:readableResultFdArray writableInto:writableResultFdArray |
6671 |
exceptionInto:exceptionResultFdArray |
|
6672 |
withTimeOut:millis |
|
7510
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
6673 |
|
8669 | 6674 |
"wait for any fd in readFdArray (an Array of integers) to become ready for reading, |
6675 |
writeFdArray to become ready for writing, |
|
7510
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
6676 |
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
|
6677 |
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
|
6678 |
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
|
6679 |
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
|
6680 |
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
|
6681 |
writableResultFdArray and exceptionResultFdArray respectively. |
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
6682 |
|
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
6683 |
Return the (overall) number of selected filedescriptors. |
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
6684 |
readableResultFdArray, writableResultFdArray and exceptionResultFdArray will |
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
6685 |
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
|
6686 |
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
|
6687 |
|
f2bf4935e7eb
New select for fair scheduling (not giving low filedescriptors
Stefan Vogel <sv@exept.de>
parents:
7488
diff
changeset
|
6688 |
self subclassResponsibility |
f2bf4935e7eb
New select for fair scheduling (not giving low filedescriptors
Stefan Vogel <sv@exept.de>
parents:
7488
diff
changeset
|
6689 |
! |
f2bf4935e7eb
New select for fair scheduling (not giving low filedescriptors
Stefan Vogel <sv@exept.de>
parents:
7488
diff
changeset
|
6690 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6691 |
selectOnAnyReadable:readFdArray writable:writeFdArray exception:exceptFdArray withTimeOut:millis |
8669 | 6692 |
"wait for any fd in readFdArray (an Array of integers) to become ready for |
6693 |
reading, writeFdArray to become ready for writing, or exceptFdArray to |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6694 |
arrive exceptional data (i.e. out-of-band data). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6695 |
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
|
6696 |
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
|
6697 |
descriptors (i.e. to check if I/O possible without blocking). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6698 |
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
|
6699 |
|
16316
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6700 |
|resultFdArray nReady| |
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6701 |
|
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6702 |
resultFdArray := Array new:1. "/ I am only interested in the first fd |
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6703 |
|
16499 | 6704 |
nReady := self |
6705 |
selectOnAnyReadable:readFdArray writable:writeFdArray exception:exceptFdArray |
|
6706 |
readableInto:resultFdArray writableInto:resultFdArray exceptionInto:resultFdArray |
|
6707 |
withTimeOut:millis. |
|
16316
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6708 |
nReady > 0 ifTrue:[ |
16499 | 6709 |
^ resultFdArray first. |
16316
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6710 |
]. |
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6711 |
|
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6712 |
^ nil |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6713 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6714 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6715 |
setBlocking:aBoolean on:fd |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6716 |
"set/clear the blocking attribute - if set (which is the default) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6717 |
a read on the fileDescriptor will block until data is available. |
7803 | 6718 |
If cleared, a read operation will immediately return with a value of nil. |
6719 |
Also affects write operations, which may perform partial writes when |
|
15914
023687d16587
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15876
diff
changeset
|
6720 |
blocking is off. Answer the previous blocking status." |
023687d16587
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15876
diff
changeset
|
6721 |
|
023687d16587
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
15876
diff
changeset
|
6722 |
"{ Pragma: +optSpace }" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6723 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6724 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6725 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6726 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6727 |
writeCheck:fd |
11835
bf65bdad3827
Avoid blocking in PipeStream (e.g. when doing a CVS checkin)
Stefan Vogel <sv@exept.de>
parents:
11834
diff
changeset
|
6728 |
"return true, if filedescriptor can be written without blocking. |
13891 | 6729 |
This is the case if data can be written to a filedescriptor |
11835
bf65bdad3827
Avoid blocking in PipeStream (e.g. when doing a CVS checkin)
Stefan Vogel <sv@exept.de>
parents:
11834
diff
changeset
|
6730 |
or the write would return an error." |
bf65bdad3827
Avoid blocking in PipeStream (e.g. when doing a CVS checkin)
Stefan Vogel <sv@exept.de>
parents:
11834
diff
changeset
|
6731 |
|
bf65bdad3827
Avoid blocking in PipeStream (e.g. when doing a CVS checkin)
Stefan Vogel <sv@exept.de>
parents:
11834
diff
changeset
|
6732 |
|result| |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6733 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6734 |
self supportsSelect ifFalse:[ |
16499 | 6735 |
"/ mhmh - what should we do then ? |
6736 |
"/ For now, return true as if data was present, |
|
6737 |
"/ and let the thread fall into the write. |
|
6738 |
"/ It will then (hopefully) be desceduled there and |
|
6739 |
"/ effectively polling for output. |
|
6740 |
^ true |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6741 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6742 |
|
16499 | 6743 |
result := self |
6744 |
selectOnAnyReadable:nil writable:(Array with:fd) exception:nil |
|
6745 |
readableInto:nil writableInto:nil exceptionInto:nil |
|
6746 |
withTimeOut:0. |
|
16316
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6747 |
|
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6748 |
"on select error, a read will immediately return, so answer true" |
448bb3c7d7eb
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
16168
diff
changeset
|
6749 |
^ result > 0. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6750 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6751 |
|
9476 | 6752 |
!AbstractOperatingSystem::PrinterInfo class methodsFor:'constants'! |
6753 |
||
6754 |
paperSizeNameForNumber:aNumber |
|
6755 |
^ self paperSizeNumberToNameMapping at:aNumber |
|
6756 |
||
6757 |
" |
|
6758 |
self paperSizeNameForNumber:1 |
|
6759 |
" |
|
6760 |
||
6761 |
"Created: / 31-07-2006 / 15:35:36 / fm" |
|
6762 |
! |
|
6763 |
||
6764 |
paperSizeNameForNumber:aNumber ifAbsent: aBlock |
|
6765 |
^ self paperSizeNumberToNameMapping at:aNumber ifAbsent: aBlock |
|
6766 |
||
6767 |
" |
|
6768 |
self paperSizeNameForNumber:11212 ifAbsent: [nil] |
|
6769 |
" |
|
6770 |
||
6771 |
"Created: / 31-07-2006 / 15:35:36 / fm" |
|
6772 |
! |
|
6773 |
||
6774 |
paperSizeNames |
|
6775 |
|codes| |
|
10510 | 6776 |
codes := self paperSizeNumberToNameTable values asSortedCollection:[:a :b | a < b]. |
6777 |
^codes collect:[:each | self paperSizeNameForNumber: each] |
|
9476 | 6778 |
|
6779 |
"Created: / 31-07-2006 / 15:35:36 / fm" |
|
10510 | 6780 |
"Modified: / 16-04-2007 / 12:03:55 / cg" |
9476 | 6781 |
! |
6782 |
||
6783 |
paperSizeNumberForName:aName |
|
6784 |
^ self paperSizeNumberToNameMapping at:aName |
|
6785 |
||
6786 |
" |
|
6787 |
self paperSizeNumberForName:'Letter, 8 1/2- by 11-inches' |
|
6788 |
" |
|
6789 |
||
6790 |
"Created: / 31-07-2006 / 15:35:37 / fm" |
|
6791 |
! |
|
6792 |
||
6793 |
paperSizeNumberToNameMapping |
|
6794 |
|d| |
|
6795 |
||
6796 |
d := self paperSizeNumberToNameTable. |
|
6797 |
||
6798 |
d keys copy do:[:k | d at:(d at:k) put:k]. |
|
6799 |
^ d. |
|
6800 |
||
6801 |
"Created: / 31-07-2006 / 15:35:37 / fm" |
|
6802 |
! |
|
6803 |
||
13891 | 6804 |
paperSizeNumberToNameTable |
9476 | 6805 |
|
6806 |
^Dictionary withKeysAndValues: |
|
13891 | 6807 |
#( |
6808 |
'Letter, 8 1/2- by 11-inches' 1 "/ Letter |
|
6809 |
'Legal 8 1/2- by 14-inches' 5 "/ Legal |
|
6810 |
'10- by 14-inch sheet' 16 "/ 10x14 |
|
6811 |
'11- by 17-inch sheet' 17 "/ 11x17 |
|
6812 |
"/ '12X11' "/ Windows 98/Me, Windows NT 4.0 and later: 12- by 11-inch sheet |
|
6813 |
'A3 sheet, 297- by 420-millimeters' 8 "/ A3 |
|
6814 |
'A3 rotated sheet, 420- by 297-millimeters' 67 "/ A3_rotated |
|
6815 |
'A4 sheet, 210- by 297-millimeters' 9 "/ A4 |
|
6816 |
'A4 rotated sheet, 297- by 210-millimeters' 55 "/ A4_rotated |
|
6817 |
'A4 small sheet, 210- by 297-millimeters' 10 "/ A4 small |
|
6818 |
'A5 sheet, 148- by 210-millimeters' 11 "/ A5 |
|
6819 |
'A5 rotated sheet, 210- by 148-millimeters' 61 "/ A5 rotated |
|
9476 | 6820 |
"/ 'a6' "/ Windows 98/Me, Windows NT 4.0 and later: A6 sheet, 105- by 148-millimeters |
6821 |
"/ 'a6_rotated' "/ Windows 98/Me, Windows NT 4.0 and later: A6 rotated sheet, 148- by 105-millimeters |
|
13891 | 6822 |
'B4 sheet, 250- by 354-millimeters' 12 "/ B4 |
9476 | 6823 |
"/ b4_jis_rotated Windows 98/Me, Windows NT 4.0 and later: B4 (JIS) rotated sheet, 364- by 257-millimeters |
13891 | 6824 |
'B5 sheet, 182- by 257-millimeter paper' 13 "/ B5 |
9476 | 6825 |
"/ b5_jis_rotated Windows 98/Me, Windows NT 4.0 and later: B5 (JIS) rotated sheet, 257- by 182-millimeters |
6826 |
"/ b6_jis Windows 98/Me, Windows NT 4.0 and later: B6 (JIS) sheet, 128- by 182-millimeters |
|
6827 |
"/ b6_jis_rotated Windows 98/Me, Windows NT 4.0 and later: B6 (JIS) rotated sheet, 182- by 128-millimeters |
|
6828 |
"/ csheet C Sheet, 17- by 22-inches |
|
6829 |
"/ dbl_japanese_postcard Windows 98/Me, Windows NT 4.0 and later: Double Japanese Postcard, 200- by 148-millimeters |
|
6830 |
"/ dbl_japanese_postcard_rotated Windows 98/Me, Windows NT 4.0 and later: Double Japanese Postcard Rotated, 148- by 200-millimeters |
|
6831 |
"/ dsheet D Sheet, 22- by 34-inches |
|
13891 | 6832 |
'#9 Envelope, 3 7/8- by 8 7/8-inches' 19 "/ env_9 |
6833 |
'#10 Envelope, 4 1/8- by 9 1/2-inches' 20 "/ env_10 |
|
6834 |
'#11 Envelope, 4 1/2- by 10 3/8-inches' 21 "/ env_11 |
|
6835 |
'#12 Envelope, 4 3/4- by 11-inches' 22 "/ env_12 |
|
6836 |
'#14 Envelope, 5- by 11 1/2-inches' 23 "/ env_15 |
|
6837 |
'C5 Envelope, 162- by 229-millimeters' 28 "/ env_c5 |
|
6838 |
'C3 Envelope, 324- by 458-millimeters' 29 "/ env_c3 |
|
6839 |
'C4 Envelope, 229- by 324-millimeters' 30 "/ env_c4 |
|
6840 |
'C6 Envelope, 114- by 162-millimeters' 31 "/ env_c6 |
|
6841 |
'C65 Envelope, 114- by 229-millimeters' 32 "/ env_c65 |
|
6842 |
'B4 Envelope, 250- by 353-millimeters' 33 "/ env_b4 |
|
6843 |
'B5 Envelope, 176- by 250-millimeters' 34 "/ env_b5 |
|
6844 |
'B6 Envelope, 176- by 125-millimeters' 35 "/ env_b6 |
|
6845 |
'DL Envelope, 110- by 220-millimeters' 27 "/ env_dl |
|
6846 |
'Italy Envelope, 110- by 230-millimeters' 36 "/ env_italy |
|
6847 |
'Monarch Envelope, 3 7/8- by 7 1/2-inches' 37 "/ env_monarch |
|
9476 | 6848 |
"/ env_personal 6 3/4 Envelope, 3 5/8- by 6 1/2-inches |
6849 |
"/ esheet E Sheet, 34- by 44-inches |
|
6850 |
"/ executive Executive, 7 1/4- by 10 1/2-inches |
|
6851 |
"/ fanfold_us US Std Fanfold, 14 7/8- by 11-inches |
|
6852 |
"/ fanfold_std_german German Std Fanfold, 8 1/2- by 12-inches |
|
6853 |
"/ fanfold_lgl_german German Legal Fanfold, 8 - by 13-inches |
|
6854 |
"/ folio Folio, 8 1/2- by 13-inch paper |
|
6855 |
"/ japanese_postcard_rotated Windows 98/Me, Windows NT 4.0 and later: Japanese Postcard Rotated, 148- by 100-millimeters |
|
6856 |
"/ jenv_chou3 Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Chou #3 |
|
6857 |
"/ jenv_chou3_rotated Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Chou #3 Rotated |
|
6858 |
"/ jenv_chou4 Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Chou #4 |
|
6859 |
"/ jenv_chou4_rotated Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Chou #4 Rotated |
|
6860 |
"/ jenv_kaku2 Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Kaku #2 |
|
6861 |
"/ jenv_kaku2_rotated Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Kaku #2 Rotated |
|
6862 |
"/ jenv_kaku3 Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Kaku #3 |
|
6863 |
"/ jenv_kaku3_rotated Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Kaku #3 Rotated |
|
6864 |
"/ jenv_you4 Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope You #4 |
|
6865 |
"/ jenv_you4_rotated Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope You #4 Rotated |
|
6866 |
"/ last Windows 2000/XP: PENV_10_ROTATED |
|
13891 | 6867 |
'Ledger, 17- by 11-inches' 4 "/ ledger |
6868 |
'Letter Rotated 11 by 8 1/2 11 inches' 54 "/ letter_rotated |
|
9476 | 6869 |
"/ lettersmall Letter Small, 8 1/2- by 11-inches |
6870 |
"/ note Note, 8 1/2- by 11-inches |
|
6871 |
"/ p16k Windows 98/Me, Windows NT 4.0 and later: PRC 16K, 146- by 215-millimeters |
|
6872 |
"/ p16k_rotated Windows 98/Me, Windows NT 4.0 and later: PRC 16K Rotated, 215- by 146-millimeters |
|
6873 |
"/ p32k Windows 98/Me, Windows NT 4.0 and later: PRC 32K, 97- by 151-millimeters |
|
6874 |
"/ p32k_rotated Windows 98/Me, Windows NT 4.0 and later: PRC 32K Rotated, 151- by 97-millimeters |
|
6875 |
"/ p32kbig Windows 98/Me, Windows NT 4.0 and later: PRC 32K(Big) 97- by 151-millimeters |
|
6876 |
"/ p32kbig_rotated Windows 98/Me, Windows NT 4.0 and later: PRC 32K(Big) Rotated, 151- by 97-millimeters |
|
6877 |
"/ penv_1 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #1, 102- by 165-millimeters |
|
6878 |
"/ penv_1_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #1 Rotated, 165- by 102-millimeters |
|
6879 |
"/ penv_2 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #2, 102- by 176-millimeters |
|
6880 |
"/ penv_2_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #2 Rotated, 176- by 102-millimeters |
|
6881 |
"/ penv_3 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #3, 125- by 176-millimeters |
|
6882 |
"/ penv_3_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #3 Rotated, 176- by 125-millimeters |
|
6883 |
"/ penv_4 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #4, 110- by 208-millimeters |
|
6884 |
"/ penv_4_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #4 Rotated, 208- by 110-millimeters |
|
6885 |
"/ penv_5 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #5, 110- by 220-millimeters |
|
6886 |
"/ penv_5_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #5 Rotated, 220- by 110-millimeters |
|
6887 |
"/ penv_6 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #6, 120- by 230-millimeters |
|
6888 |
"/ penv_6_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #6 Rotated, 230- by 120-millimeters |
|
6889 |
"/ penv_7 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #7, 160- by 230-millimeters |
|
6890 |
"/ penv_7_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #7 Rotated, 230- by 160-millimeters |
|
6891 |
"/ penv_8 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #8, 120- by 309-millimeters |
|
6892 |
"/ penv_8_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #8 Rotated, 309- by 120-millimeters |
|
6893 |
"/ penv_9 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #9, 229- by 324-millimeters |
|
6894 |
"/ penv_9_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #9 Rotated, 324- by 229-millimeters |
|
6895 |
"/ penv_10 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #10, 324- by 458-millimeters |
|
6896 |
"/ penv_10_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #10 Rotated, 458- by 324-millimeters |
|
6897 |
"/ quarto Quarto, 215- by 275-millimeter paper |
|
6898 |
"/ statement Statement, 5 1/2- by 8 1/2-inches |
|
6899 |
"/ tabloid Tabloid, 11- by 17-inches |
|
13891 | 6900 |
). |
9476 | 6901 |
|
6902 |
"Created: / 31-07-2006 / 15:35:37 / fm" |
|
6903 |
! |
|
6904 |
||
13891 | 6905 |
statusNumberToDescriptionForNumber:aNumber |
11403 | 6906 |
^ self statusNumberToDescriptionMapping at:aNumber ifAbsent:[('Unknown (%1)' bindWith:aNumber printString)] |
9476 | 6907 |
|
6908 |
" |
|
6909 |
self statusNumberToDescriptionForNumber:1 |
|
6910 |
" |
|
6911 |
||
6912 |
"Created: / 01-08-2006 / 14:31:18 / fm" |
|
6913 |
! |
|
6914 |
||
6915 |
statusNumberToDescriptionMapping |
|
6916 |
|d| |
|
6917 |
||
6918 |
d := self statusNumberToDescriptionTable. |
|
6919 |
||
6920 |
d keys copy do:[:k | d at:(d at:k) put:k]. |
|
6921 |
^ d. |
|
6922 |
||
6923 |
"Created: / 01-08-2006 / 14:31:05 / fm" |
|
6924 |
! |
|
6925 |
||
13891 | 6926 |
statusNumberToDescriptionTable |
9476 | 6927 |
|
6928 |
^Dictionary withKeysAndValues: |
|
13891 | 6929 |
#( 'Ready' 0 "/ PRINTER_STATUS_READY |
6930 |
'Paused' 1 "/ PRINTER_STATUS_PAUSED |
|
6931 |
'Error' 2 "/ PRINTER_STATUS_ERROR |
|
6932 |
'Deleting...' 4 "/ PRINTER_STATUS_PENDING_DELETION |
|
6933 |
'Paper Jam' 8 "/ PRINTER_STATUS_PAPER_JAM |
|
6934 |
'Paper Out' 16 "/ PRINTER_STATUS_PAPER_OUT |
|
6935 |
'Manual Feed Required' 32 "/ PRINTER_STATUS_MANUAL_FEED |
|
6936 |
'Paper Problem' 64 "/ PRINTER_STATUS_PAPER_PROBLEM |
|
6937 |
'Offline' 128 "/ PRINTER_STATUS_OFFLINE |
|
6938 |
'Downloading Job' 256 "/ PRINTER_STATUS_IO_ACTIVE |
|
6939 |
'Busy' 512 "/ PRINTER_STATUS_BUSY |
|
6940 |
'Printing' 1024 "/ PRINTER_STATUS_PRINTING |
|
6941 |
'Output Bill Full' 2048 "/ PRINTER_STATUS_OUTPUT_BIN_FULL |
|
6942 |
'Not Available' 4096 "/ PRINTER_STATUS_NOT_AVAILABLE |
|
6943 |
'Waiting' 8192 "/ PRINTER_STATUS_WAITING |
|
6944 |
'Processing Job' 16384 "/ PRINTER_STATUS_PROCESSING |
|
6945 |
'Initializing' 32768 "/ PRINTER_STATUS_INITIALIZING |
|
6946 |
'Warming Up' 65536 "/ PRINTER_STATUS_WARMING_UP |
|
6947 |
'Toner Low' 131072 "/ PRINTER_STATUS_TONER_LOW |
|
6948 |
'Toner Out' 262144 "/ PRINTER_STATUS_NO_TONER |
|
6949 |
'Page too Complex' 524288 "/ PRINTER_STATUS_PAGE_PUNT |
|
6950 |
'User Intervention Required'1048576 "/ PRINTER_STATUS_USER_INTERVENTION |
|
6951 |
'Out of Memory' 2097152 "/ PRINTER_STATUS_OUT_OF_MEMORY |
|
6952 |
'Door Open' 4194304 "/ PRINTER_STATUS_DOOR_OPEN |
|
6953 |
'Unable to connect' 8388608 "/ PRINTER_STATUS_SERVER_UNKNOWN |
|
6954 |
'Power Save Mode' 16777216 "/ PRINTER_STATUS_POWER_SAVE |
|
6955 |
). |
|
9476 | 6956 |
|
6957 |
"Created: / 01-08-2006 / 14:23:33 / fm" |
|
6958 |
! ! |
|
6959 |
||
6960 |
!AbstractOperatingSystem::PrinterInfo methodsFor:'accessing'! |
|
6961 |
||
6962 |
attributes |
|
6963 |
^ attributes |
|
6964 |
||
6965 |
"Created: / 27-07-2006 / 12:16:59 / fm" |
|
6966 |
! |
|
6967 |
||
6968 |
collate |
|
10096 | 6969 |
|properties| |
6970 |
||
6971 |
properties := self documentProperties. |
|
6972 |
^ properties isNil ifTrue:[ nil ] ifFalse:[ properties collate = 1 ] |
|
9476 | 6973 |
|
6974 |
"Created: / 01-08-2006 / 09:56:14 / fm" |
|
6975 |
"Modified: / 01-08-2006 / 11:49:18 / fm" |
|
10096 | 6976 |
"Modified: / 18-10-2006 / 12:02:29 / User" |
9476 | 6977 |
! |
6978 |
||
6979 |
collate: aBoolean |
|
10510 | 6980 |
|integer| |
6981 |
||
13891 | 6982 |
integer:= aBoolean |
6983 |
ifTrue:[1] "DMCOLLATE_TRUE" |
|
6984 |
ifFalse:[0]. "DMCOLLATE_FALSE" |
|
10510 | 6985 |
self documentProperties collate: integer |
9476 | 6986 |
|
6987 |
"Created: / 01-08-2006 / 09:56:01 / fm" |
|
10510 | 6988 |
"Modified: / 16-04-2007 / 12:01:30 / cg" |
9476 | 6989 |
! |
6990 |
||
6991 |
comment |
|
10510 | 6992 |
^self printerInfo2 pComment |
9476 | 6993 |
|
6994 |
"Created: / 01-08-2006 / 15:06:20 / fm" |
|
10510 | 6995 |
"Modified: / 16-04-2007 / 12:01:42 / cg" |
9476 | 6996 |
! |
6997 |
||
6998 |
copies |
|
10096 | 6999 |
|properties| |
7000 |
||
7001 |
properties := self documentProperties. |
|
7002 |
^ properties isNil ifTrue:[ nil ] ifFalse:[ properties copies ] |
|
9476 | 7003 |
|
7004 |
"Created: / 31-07-2006 / 13:46:53 / fm" |
|
10096 | 7005 |
"Modified: / 18-10-2006 / 12:02:14 / User" |
9476 | 7006 |
! |
7007 |
||
7008 |
copies: anInteger |
|
10510 | 7009 |
self documentProperties copies: anInteger |
9476 | 7010 |
|
7011 |
"Created: / 31-07-2006 / 13:54:55 / fm" |
|
10510 | 7012 |
"Modified: / 16-04-2007 / 12:01:48 / cg" |
9476 | 7013 |
! |
7014 |
||
7015 |
documentProperties |
|
7016 |
||
7017 |
^documentProperties |
|
7018 |
||
7019 |
"Created: / 28-07-2006 / 11:50:04 / fm" |
|
7020 |
"Modified: / 31-07-2006 / 13:06:24 / fm" |
|
7021 |
! |
|
7022 |
||
13891 | 7023 |
documentProperties: aDevModeStructure |
9476 | 7024 |
|
7025 |
documentProperties := aDevModeStructure. |
|
7026 |
||
7027 |
"Created: / 28-07-2006 / 11:47:31 / fm" |
|
7028 |
! |
|
7029 |
||
7030 |
driverName |
|
7031 |
||
10510 | 7032 |
^self attributes at:#driverName |
9476 | 7033 |
|
7034 |
"Created: / 01-08-2006 / 15:33:08 / fm" |
|
10510 | 7035 |
"Modified: / 16-04-2007 / 12:01:53 / cg" |
9476 | 7036 |
! |
7037 |
||
7038 |
location |
|
7039 |
||
10510 | 7040 |
^self printerInfo2 pLocation |
9476 | 7041 |
|
7042 |
"Created: / 01-08-2006 / 15:06:28 / fm" |
|
10510 | 7043 |
"Modified: / 16-04-2007 / 12:02:07 / cg" |
9476 | 7044 |
! |
7045 |
||
7046 |
longName |
|
10510 | 7047 |
^attributes at:#longName ifAbsent:[''] |
9476 | 7048 |
|
7049 |
"Created: / 28-07-2006 / 12:06:32 / fm" |
|
10510 | 7050 |
"Modified: / 16-04-2007 / 12:02:11 / cg" |
9476 | 7051 |
! |
7052 |
||
7053 |
medium |
|
7054 |
||
10510 | 7055 |
^self attributes at:#medium |
9476 | 7056 |
|
7057 |
"Created: / 01-08-2006 / 15:34:26 / fm" |
|
10510 | 7058 |
"Modified: / 16-04-2007 / 12:02:14 / cg" |
9476 | 7059 |
! |
7060 |
||
7061 |
orientation |
|
10096 | 7062 |
|properties| |
7063 |
||
7064 |
properties := self documentProperties. |
|
7065 |
^ properties isNil ifTrue:[ nil ] ifFalse:[ properties orientation ] |
|
9476 | 7066 |
|
7067 |
"Created: / 28-07-2006 / 16:44:26 / fm" |
|
10096 | 7068 |
"Modified: / 18-10-2006 / 12:01:36 / User" |
7069 |
! |
|
7070 |
||
13891 | 7071 |
orientation:anInteger |
10096 | 7072 |
|properties| |
7073 |
||
7074 |
properties := self documentProperties. |
|
7075 |
properties notNil ifTrue:[ |
|
13891 | 7076 |
properties orientation:anInteger |
10096 | 7077 |
] |
9476 | 7078 |
|
7079 |
"Created: / 28-07-2006 / 17:22:44 / fm" |
|
10096 | 7080 |
"Modified: / 18-10-2006 / 12:01:40 / User" |
9476 | 7081 |
! |
7082 |
||
7083 |
pDriverName |
|
7084 |
||
10510 | 7085 |
^self printerInfo2 pDriverName |
9476 | 7086 |
|
7087 |
"Created: / 01-08-2006 / 15:33:08 / fm" |
|
10510 | 7088 |
"Modified: / 16-04-2007 / 12:02:21 / cg" |
9476 | 7089 |
! |
7090 |
||
7091 |
paperSize |
|
10096 | 7092 |
|properties| |
7093 |
||
7094 |
properties := self documentProperties. |
|
7095 |
^ properties isNil ifTrue:[ nil ] ifFalse:[ properties paperSize ] |
|
9476 | 7096 |
|
7097 |
"Created: / 31-07-2006 / 15:23:29 / fm" |
|
7098 |
"Modified: / 31-07-2006 / 16:25:58 / fm" |
|
10096 | 7099 |
"Modified: / 18-10-2006 / 12:01:45 / User" |
7100 |
! |
|
7101 |
||
13891 | 7102 |
paperSize:anInteger |
10096 | 7103 |
|properties| |
7104 |
||
7105 |
properties := self documentProperties. |
|
7106 |
properties notNil ifTrue:[ |
|
13891 | 7107 |
properties paperSize:anInteger |
10096 | 7108 |
] |
9476 | 7109 |
|
7110 |
"Created: / 31-07-2006 / 15:23:20 / fm" |
|
10096 | 7111 |
"Modified: / 18-10-2006 / 12:01:48 / User" |
9476 | 7112 |
! |
7113 |
||
7114 |
paperSizeName |
|
7115 |
^ self class paperSizeNameForNumber:self paperSize ifAbsent:[nil]. |
|
7116 |
||
7117 |
"Created: / 31-07-2006 / 15:35:12 / fm" |
|
7118 |
! |
|
7119 |
||
13891 | 7120 |
paperSizeName:aString |
10096 | 7121 |
self paperSize:(self class paperSizeNumberForName:aString) |
7122 |
||
7123 |
"Modified: / 18-10-2006 / 12:01:56 / User" |
|
9476 | 7124 |
! |
7125 |
||
7126 |
printQuality |
|
7127 |
^self documentProperties printQuality |
|
7128 |
||
7129 |
"Created: / 04-08-2006 / 13:10:06 / fm" |
|
7130 |
! |
|
7131 |
||
7132 |
printerName |
|
7133 |
^ printerName |
|
7134 |
||
7135 |
"Created: / 27-07-2006 / 12:16:59 / fm" |
|
7136 |
! |
|
7137 |
||
13891 | 7138 |
printerName:printerNameArg attributes:attributesArg |
9476 | 7139 |
|
7140 |
printerName := printerNameArg. |
|
7141 |
attributes := attributesArg. |
|
7142 |
||
7143 |
"Created: / 27-07-2006 / 12:29:18 / fm" |
|
7144 |
! |
|
7145 |
||
7146 |
remotePrinterHost |
|
10510 | 7147 |
^attributes at:#remotePrinterHost ifAbsent:[''] |
9476 | 7148 |
|
7149 |
"Created: / 28-07-2006 / 16:30:13 / fm" |
|
10510 | 7150 |
"Modified: / 16-04-2007 / 12:02:32 / cg" |
9476 | 7151 |
! |
7152 |
||
7153 |
remotePrinterName |
|
10510 | 7154 |
^attributes at:#remotePrinterName ifAbsent:[''] |
9476 | 7155 |
|
7156 |
"Created: / 28-07-2006 / 16:30:06 / fm" |
|
10510 | 7157 |
"Modified: / 16-04-2007 / 12:03:23 / cg" |
9476 | 7158 |
! |
7159 |
||
7160 |
status |
|
10510 | 7161 |
self isAvailable ifFalse:[^'']. |
7162 |
^self class statusNumberToDescriptionForNumber: self getPrinterInfo2 status |
|
9476 | 7163 |
|
7164 |
"Created: / 01-08-2006 / 13:48:58 / fm" |
|
10510 | 7165 |
"Modified: / 16-04-2007 / 12:03:41 / cg" |
9476 | 7166 |
! |
7167 |
||
7168 |
userFriendlyName |
|
7169 |
^self remotePrinterName isEmpty |
|
13891 | 7170 |
ifTrue:[self printerName] |
7171 |
ifFalse:[self remotePrinterName, ' on ', self remotePrinterHost] |
|
9476 | 7172 |
|
7173 |
"Created: / 03-08-2006 / 12:50:09 / fm" |
|
7174 |
! ! |
|
7175 |
||
7176 |
!AbstractOperatingSystem::PrinterInfo methodsFor:'dc creation'! |
|
7177 |
||
7178 |
createDC |
|
10528 | 7179 |
|driverName pName| |
10510 | 7180 |
|
7181 |
driverName := self driverName. |
|
10528 | 7182 |
pName := self printerName. |
10513 | 7183 |
"/ Transcript show:driverName; show:' '; showCR:printerName. |
10510 | 7184 |
|
13891 | 7185 |
^OperatingSystem createPrinterDC:driverName |
7186 |
device:pName |
|
7187 |
output:self medium |
|
7188 |
initData:self documentProperties. |
|
9476 | 7189 |
|
7190 |
"Created: / 02-08-2006 / 16:51:02 / fm" |
|
10513 | 7191 |
"Modified: / 16-04-2007 / 13:56:56 / cg" |
9476 | 7192 |
! ! |
7193 |
||
7194 |
!AbstractOperatingSystem::PrinterInfo methodsFor:'dialogs'! |
|
7195 |
||
7196 |
openPropertiesDialog |
|
9844 | 7197 |
"Returns true if the documentProperties have been accepted. Otherwise, returns false" |
7198 |
||
9476 | 7199 |
|h newDocumentProperties| |
7200 |
||
7201 |
h := OperatingSystem openPrinter: self printerName. |
|
13891 | 7202 |
newDocumentProperties := OperatingSystem documentPropertiesDialogFor:nil |
7203 |
hPrinter:h |
|
7204 |
pDeviceName: self printerName |
|
7205 |
devModeInput:self documentProperties. |
|
9844 | 7206 |
(newDocumentProperties contains:[:el | el ~= 0]) |
13891 | 7207 |
ifFalse:[^false]. |
9476 | 7208 |
self documentProperties: newDocumentProperties. |
7209 |
OperatingSystem closePrinter:h. |
|
7210 |
^true |
|
7211 |
||
7212 |
"Created: / 28-07-2006 / 11:44:01 / fm" |
|
7213 |
"Modified: / 01-08-2006 / 11:55:49 / fm" |
|
9844 | 7214 |
"Modified: / 13-09-2006 / 11:36:10 / cg" |
9476 | 7215 |
! ! |
7216 |
||
7217 |
!AbstractOperatingSystem::PrinterInfo methodsFor:'modifying'! |
|
7218 |
||
7219 |
setLandscapeOrientation |
|
10510 | 7220 |
"DMORIENT_LANDSCAPE = 2" |
7221 |
self documentProperties orientation: 2 |
|
9476 | 7222 |
|
7223 |
"Created: / 28-07-2006 / 15:53:35 / fm" |
|
10510 | 7224 |
"Modified: / 16-04-2007 / 12:03:30 / cg" |
9476 | 7225 |
! |
7226 |
||
7227 |
setNumberOfCopies: n |
|
7228 |
||
10510 | 7229 |
self documentProperties copies: n |
9476 | 7230 |
|
7231 |
"Created: / 28-07-2006 / 16:04:04 / fm" |
|
10510 | 7232 |
"Modified: / 16-04-2007 / 12:03:33 / cg" |
9476 | 7233 |
! |
7234 |
||
7235 |
setPortraitOrientation |
|
10510 | 7236 |
"DMORIENT_PORTRAIT = 1" |
7237 |
self documentProperties orientation: 1 |
|
9476 | 7238 |
|
7239 |
"Created: / 28-07-2006 / 15:49:45 / fm" |
|
10510 | 7240 |
"Modified: / 16-04-2007 / 12:03:36 / cg" |
9476 | 7241 |
! ! |
7242 |
||
7243 |
!AbstractOperatingSystem::PrinterInfo methodsFor:'printing & storing'! |
|
7244 |
||
7245 |
printOn:aStream |
|
7246 |
aStream nextPutAll:(self class name); nextPutAll:'('. |
|
7247 |
printerName printOn:aStream. |
|
7248 |
aStream nextPutAll:')'. |
|
7249 |
||
7250 |
"Created: / 27-07-2006 / 12:30:28 / fm" |
|
7251 |
! ! |
|
7252 |
||
7253 |
!AbstractOperatingSystem::PrinterInfo methodsFor:'private'! |
|
7254 |
||
7255 |
getDocumentProperties |
|
7256 |
"Returns a aDevModeStructure" |
|
10510 | 7257 |
|
7258 |
|h devMode | |
|
9476 | 7259 |
|
7260 |
h := OperatingSystem openPrinter: self printerName. |
|
7261 |
devMode := OperatingSystem getDocumentProperties:nil |
|
13891 | 7262 |
hPrinter:h |
7263 |
pDeviceName: self printerName. |
|
9476 | 7264 |
OperatingSystem closePrinter: h. |
7265 |
^devMode |
|
7266 |
||
7267 |
"Created: / 28-07-2006 / 11:49:33 / fm" |
|
7268 |
"Modified: / 31-07-2006 / 10:33:04 / fm" |
|
10510 | 7269 |
"Modified: / 16-04-2007 / 12:02:00 / cg" |
9476 | 7270 |
! |
7271 |
||
7272 |
getPrinterInfo2 |
|
7273 |
"Returns a aPrinterInfo2 structure" |
|
13891 | 7274 |
|
10097 | 7275 |
printerInfo2 := OperatingSystem getPrinterInfo2:self printerName. |
7276 |
^ printerInfo2 |
|
9476 | 7277 |
|
7278 |
"Created: / 01-08-2006 / 13:50:55 / fm" |
|
7279 |
"Modified: / 01-08-2006 / 15:11:03 / fm" |
|
10097 | 7280 |
"Modified: / 18-10-2006 / 12:03:54 / User" |
9476 | 7281 |
! |
7282 |
||
7283 |
printerInfo2 |
|
7284 |
"Returns a aPrinterInfo2 structure" |
|
13891 | 7285 |
|
10097 | 7286 |
printerInfo2 isNil ifTrue:[ |
13891 | 7287 |
self getPrinterInfo2. |
10097 | 7288 |
]. |
7289 |
^ printerInfo2 |
|
9476 | 7290 |
|
7291 |
"Created: / 01-08-2006 / 15:10:18 / fm" |
|
10097 | 7292 |
"Modified: / 18-10-2006 / 12:03:57 / User" |
9476 | 7293 |
! |
7294 |
||
7295 |
setDocumentProperties |
|
13891 | 7296 |
"Sets a aDevModeStructure or nil if the printer is not available" |
9476 | 7297 |
|
7298 |
self documentProperties: self getDocumentProperties |
|
7299 |
||
7300 |
"Created: / 31-07-2006 / 13:04:58 / fm" |
|
7301 |
! ! |
|
7302 |
||
7303 |
!AbstractOperatingSystem::PrinterInfo methodsFor:'queries'! |
|
7304 |
||
7305 |
isAvailable |
|
7306 |
||
10510 | 7307 |
^self documentProperties notNil |
9476 | 7308 |
|
7309 |
"Created: / 31-07-2006 / 13:08:58 / fm" |
|
10510 | 7310 |
"Modified: / 16-04-2007 / 12:02:05 / cg" |
9476 | 7311 |
! ! |
7312 |
||
7514 | 7313 |
!AbstractOperatingSystem::TimeInfo methodsFor:'accessing'! |
7314 |
||
7315 |
at:index |
|
7316 |
"backward compatibility" |
|
7317 |
||
8357 | 7318 |
<resource: #obsolete> |
7514 | 7319 |
self obsoleteMethodWarning:'use accessor for index ', index printString. |
7739
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
7320 |
|
7514 | 7321 |
index == 1 ifTrue:[ |
13891 | 7322 |
^ self year. |
7514 | 7323 |
]. |
7324 |
index == 2 ifTrue:[ |
|
13891 | 7325 |
^ self month. |
7514 | 7326 |
]. |
7327 |
index == 3 ifTrue:[ |
|
13891 | 7328 |
^ self day. |
7514 | 7329 |
]. |
7330 |
index == 4 ifTrue:[ |
|
13891 | 7331 |
^ self hours. |
7514 | 7332 |
]. |
7333 |
index == 5 ifTrue:[ |
|
13891 | 7334 |
^ self minutes. |
7514 | 7335 |
]. |
7336 |
index == 6 ifTrue:[ |
|
13891 | 7337 |
^ self seconds. |
7514 | 7338 |
]. |
7339 |
index == 7 ifTrue:[ |
|
13891 | 7340 |
^ self utcOffset. |
7514 | 7341 |
]. |
7342 |
index == 8 ifTrue:[ |
|
13891 | 7343 |
^ self dst. |
7514 | 7344 |
]. |
7345 |
index == 9 ifTrue:[ |
|
13891 | 7346 |
^ self milliseconds. |
7514 | 7347 |
]. |
7348 |
index == 10 ifTrue:[ |
|
13891 | 7349 |
^ self dayInYear. |
7514 | 7350 |
]. |
7351 |
index == 11 ifTrue:[ |
|
13891 | 7352 |
^ self dayInWeek. |
7514 | 7353 |
]. |
7354 |
self subscriptBoundsError:index |
|
7355 |
! |
|
7356 |
||
7357 |
day |
|
7358 |
^ day |
|
7359 |
! |
|
7360 |
||
7361 |
dayInWeek |
|
16929
8f47855b7f97
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16906
diff
changeset
|
7362 |
<resource: #obsolete> |
7514 | 7363 |
^ dayInWeek |
7364 |
! |
|
7365 |
||
7366 |
dayInYear |
|
16929
8f47855b7f97
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16906
diff
changeset
|
7367 |
<resource: #obsolete> |
12816
ff4a03e2da97
TimeInfo>>#dayInYear - compute if missing
Stefan Vogel <sv@exept.de>
parents:
12755
diff
changeset
|
7368 |
"answer of compute the day of the year - if necessary |
ff4a03e2da97
TimeInfo>>#dayInYear - compute if missing
Stefan Vogel <sv@exept.de>
parents:
12755
diff
changeset
|
7369 |
(it is not set in windows)" |
ff4a03e2da97
TimeInfo>>#dayInYear - compute if missing
Stefan Vogel <sv@exept.de>
parents:
12755
diff
changeset
|
7370 |
|
ff4a03e2da97
TimeInfo>>#dayInYear - compute if missing
Stefan Vogel <sv@exept.de>
parents:
12755
diff
changeset
|
7371 |
|dayCount| |
ff4a03e2da97
TimeInfo>>#dayInYear - compute if missing
Stefan Vogel <sv@exept.de>
parents:
12755
diff
changeset
|
7372 |
|
ff4a03e2da97
TimeInfo>>#dayInYear - compute if missing
Stefan Vogel <sv@exept.de>
parents:
12755
diff
changeset
|
7373 |
dayInYear notNil ifTrue:[ |
13891 | 7374 |
^ dayInYear. |
12816
ff4a03e2da97
TimeInfo>>#dayInYear - compute if missing
Stefan Vogel <sv@exept.de>
parents:
12755
diff
changeset
|
7375 |
]. |
ff4a03e2da97
TimeInfo>>#dayInYear - compute if missing
Stefan Vogel <sv@exept.de>
parents:
12755
diff
changeset
|
7376 |
|
ff4a03e2da97
TimeInfo>>#dayInYear - compute if missing
Stefan Vogel <sv@exept.de>
parents:
12755
diff
changeset
|
7377 |
dayCount := #(0 31 59 90 120 151 181 212 243 273 304 334) at:month. |
13891 | 7378 |
(month > 2 |
7379 |
and:[(year \\ 4 == 0) |
|
12816
ff4a03e2da97
TimeInfo>>#dayInYear - compute if missing
Stefan Vogel <sv@exept.de>
parents:
12755
diff
changeset
|
7380 |
and:[(year \\ 100 ~~ 0) |
ff4a03e2da97
TimeInfo>>#dayInYear - compute if missing
Stefan Vogel <sv@exept.de>
parents:
12755
diff
changeset
|
7381 |
and:[(year \\ 400 == 0)]]]) ifTrue:[ |
13891 | 7382 |
"leap year and month after February" |
7383 |
dayCount := dayCount + 1. |
|
12816
ff4a03e2da97
TimeInfo>>#dayInYear - compute if missing
Stefan Vogel <sv@exept.de>
parents:
12755
diff
changeset
|
7384 |
]. |
ff4a03e2da97
TimeInfo>>#dayInYear - compute if missing
Stefan Vogel <sv@exept.de>
parents:
12755
diff
changeset
|
7385 |
|
ff4a03e2da97
TimeInfo>>#dayInYear - compute if missing
Stefan Vogel <sv@exept.de>
parents:
12755
diff
changeset
|
7386 |
^ dayCount + day. |
ff4a03e2da97
TimeInfo>>#dayInYear - compute if missing
Stefan Vogel <sv@exept.de>
parents:
12755
diff
changeset
|
7387 |
|
ff4a03e2da97
TimeInfo>>#dayInYear - compute if missing
Stefan Vogel <sv@exept.de>
parents:
12755
diff
changeset
|
7388 |
|
13891 | 7389 |
" |
12816
ff4a03e2da97
TimeInfo>>#dayInYear - compute if missing
Stefan Vogel <sv@exept.de>
parents:
12755
diff
changeset
|
7390 |
|daysSoFar| |
ff4a03e2da97
TimeInfo>>#dayInYear - compute if missing
Stefan Vogel <sv@exept.de>
parents:
12755
diff
changeset
|
7391 |
|
ff4a03e2da97
TimeInfo>>#dayInYear - compute if missing
Stefan Vogel <sv@exept.de>
parents:
12755
diff
changeset
|
7392 |
daysSoFar := 0. |
ff4a03e2da97
TimeInfo>>#dayInYear - compute if missing
Stefan Vogel <sv@exept.de>
parents:
12755
diff
changeset
|
7393 |
#(0 31 28 31 30 31 30 31 31 30 31 30) collect:[:daysInMonth| daysSoFar := daysSoFar + daysInMonth. daysSoFar] |
ff4a03e2da97
TimeInfo>>#dayInYear - compute if missing
Stefan Vogel <sv@exept.de>
parents:
12755
diff
changeset
|
7394 |
" |
7514 | 7395 |
! |
7396 |
||
7397 |
dst |
|
7398 |
^ dst |
|
7399 |
! |
|
7400 |
||
7401 |
hours |
|
7402 |
^ hours |
|
7403 |
! |
|
7404 |
||
7405 |
milliseconds |
|
7406 |
^ milliseconds |
|
7407 |
! |
|
7408 |
||
7409 |
milliseconds:something |
|
7410 |
milliseconds := something. |
|
7411 |
! |
|
7412 |
||
7413 |
minutes |
|
7414 |
^ minutes |
|
7415 |
! |
|
7416 |
||
7417 |
month |
|
7418 |
^ month |
|
7419 |
! |
|
7420 |
||
7421 |
seconds |
|
7422 |
^ seconds |
|
7423 |
! |
|
7424 |
||
7425 |
utcOffset |
|
8887 | 7426 |
"return the difference between UTC (Greenwich Mean Time) and the local time in seconds. |
7427 |
If daylight saving time applies to ourself, take that into account. |
|
7428 |
Add utcOffset to convert from local time to UTC time. |
|
7429 |
Subtract utcOffset to convert from UTC time to local time. |
|
7430 |
||
7431 |
If utcOffset is negative, the local timezone is east of Greenwich. |
|
7432 |
If utcOffset is positive, the local timezone is west of Greenwich." |
|
7433 |
||
7514 | 7434 |
^ utcOffset |
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7435 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7436 |
" |
17002
41fd1e27f184
class: AbstractOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
17001
diff
changeset
|
7437 |
(OperatingSystem timeInfoFromSeconds:Timestamp now utcSecondsSince1970 milliseconds:0 localTime:true) |
17006 | 7438 |
utcOffset |
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7439 |
" |
7514 | 7440 |
! |
7441 |
||
16968
cde6c2e2e9be
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16948
diff
changeset
|
7442 |
utcOffset:something |
cde6c2e2e9be
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16948
diff
changeset
|
7443 |
utcOffset := something. |
cde6c2e2e9be
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16948
diff
changeset
|
7444 |
! |
cde6c2e2e9be
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
16948
diff
changeset
|
7445 |
|
7514 | 7446 |
year |
7447 |
^ year |
|
7448 |
! |
|
7449 |
||
8669 | 7450 |
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
|
7451 |
"set instance variables (automatically generated)" |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
7452 |
|
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
7453 |
year := yearArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
7454 |
month := monthArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
7455 |
day := dayArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
7456 |
hours := hoursArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
7457 |
minutes := minutesArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
7458 |
seconds := secondsArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
7459 |
milliseconds := millisecondsArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
7460 |
utcOffset := utcOffsetArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
7461 |
dst := dstArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
7462 |
dayInYear := dayInYearArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
7463 |
dayInWeek := dayInWeekArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
7464 |
! |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
7465 |
|
8669 | 7466 |
year:yearArg month:monthArg day:dayArg hours:hoursArg minutes:minutesArg seconds:secondsArg utcOffset:utcOffsetArg dst:dstArg dayInYear:dayInYearArg dayInWeek:dayInWeekArg |
7514 | 7467 |
"set instance variables (automatically generated)" |
7468 |
||
7469 |
year := yearArg. |
|
7470 |
month := monthArg. |
|
7471 |
day := dayArg. |
|
7472 |
hours := hoursArg. |
|
7473 |
minutes := minutesArg. |
|
7474 |
seconds := secondsArg. |
|
7475 |
utcOffset := utcOffsetArg. |
|
7476 |
dst := dstArg. |
|
7477 |
dayInYear := dayInYearArg. |
|
7478 |
dayInWeek := dayInWeekArg. |
|
7479 |
! ! |
|
7480 |
||
13228
7b045d3ffcee
New: ::TimeInfo >>asDate and >>asTime
Stefan Vogel <sv@exept.de>
parents:
13160
diff
changeset
|
7481 |
!AbstractOperatingSystem::TimeInfo methodsFor:'converting'! |
7b045d3ffcee
New: ::TimeInfo >>asDate and >>asTime
Stefan Vogel <sv@exept.de>
parents:
13160
diff
changeset
|
7482 |
|
7b045d3ffcee
New: ::TimeInfo >>asDate and >>asTime
Stefan Vogel <sv@exept.de>
parents:
13160
diff
changeset
|
7483 |
asDate |
7b045d3ffcee
New: ::TimeInfo >>asDate and >>asTime
Stefan Vogel <sv@exept.de>
parents:
13160
diff
changeset
|
7484 |
^ Date new year:year month:month day:day. |
7b045d3ffcee
New: ::TimeInfo >>asDate and >>asTime
Stefan Vogel <sv@exept.de>
parents:
13160
diff
changeset
|
7485 |
! |
7b045d3ffcee
New: ::TimeInfo >>asDate and >>asTime
Stefan Vogel <sv@exept.de>
parents:
13160
diff
changeset
|
7486 |
|
7b045d3ffcee
New: ::TimeInfo >>asDate and >>asTime
Stefan Vogel <sv@exept.de>
parents:
13160
diff
changeset
|
7487 |
asTime |
7b045d3ffcee
New: ::TimeInfo >>asDate and >>asTime
Stefan Vogel <sv@exept.de>
parents:
13160
diff
changeset
|
7488 |
^ Time hours:hours minutes:minutes seconds:seconds |
7b045d3ffcee
New: ::TimeInfo >>asDate and >>asTime
Stefan Vogel <sv@exept.de>
parents:
13160
diff
changeset
|
7489 |
! ! |
7b045d3ffcee
New: ::TimeInfo >>asDate and >>asTime
Stefan Vogel <sv@exept.de>
parents:
13160
diff
changeset
|
7490 |
|
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7491 |
!AbstractOperatingSystem::TimeZoneInfo class methodsFor:'documentation'! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7492 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7493 |
documentation |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7494 |
" |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7495 |
Bias |
13891 | 7496 |
The current bias for local time translation on this computer, in minutes. |
7497 |
The bias is the difference, in minutes, between Coordinated Universal Time (UTC) |
|
7498 |
and local time. |
|
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7499 |
All translations between UTC and local time are based on the following formula: |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7500 |
|
13891 | 7501 |
UTC = local time + bias |
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7502 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7503 |
StandardName |
13891 | 7504 |
A description for standard time. For example, 'EST' could indicate Eastern Standard Time. |
7505 |
The string will be returned unchanged by the GetTimeZoneInformation function. |
|
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7506 |
This string can be empty. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7507 |
This is for information only - do not depend on the value of the string. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7508 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7509 |
StandardDate |
13891 | 7510 |
A Timestamp that contains a date and local time when the transition from daylight saving |
7511 |
time to standard time occurs on this operating system. |
|
7512 |
If the time zone does not support daylight saving time or if the caller needs to disable |
|
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7513 |
daylight saving time, the standardDate is nil. |
13891 | 7514 |
If this date is specified, the DaylightDate member of this structure must also be specified. |
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7515 |
Otherwise, the system assumes the time zone data is invalid and no changes will be applied. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7516 |
|
13891 | 7517 |
To select the correct day in the month, set the wYear member to zero, the wHour and wMinute members |
7518 |
to the transition time, the wDayOfWeek member to the appropriate weekday, and the wDay member to indicate |
|
7519 |
the occurrence of the day of the week within the month (1 to 5, where 5 indicates the final occurrence |
|
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7520 |
during the month if that day of the week does not occur 5 times). |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7521 |
|
13891 | 7522 |
Using this notation, specify 02:00 on the first Sunday in April as follows: |
7523 |
wHour = 2, wMonth = 4, wDayOfWeek = 0, wDay = 1. |
|
7524 |
Specify 02:00 on the last Thursday in October as follows: |
|
7525 |
wHour = 2, wMonth = 10, wDayOfWeek = 4, wDay = 5. |
|
7526 |
||
7527 |
If the wYear member is not zero, the transition date is absolute; it will only occur one time. |
|
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7528 |
Otherwise, it is a relative date that occurs yearly. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7529 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7530 |
StandardBias |
13891 | 7531 |
The bias value to be used during local time translations that occur during standard time. |
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7532 |
This member is ignored if a value for the StandardDate member is not supplied. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7533 |
|
13891 | 7534 |
This value is added to the value of the Bias member to form the bias used during standard time. |
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7535 |
In most time zones, the value of this member is zero. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7536 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7537 |
DaylightName |
13891 | 7538 |
A description for daylight saving time. For example, 'PDT' could indicate Pacific Daylight Time. |
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7539 |
The string will be returned unchanged by the GetTimeZoneInformation function. This string can be empty. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7540 |
This is for information only - do not depend on the value of the string. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7541 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7542 |
DaylightDate |
13891 | 7543 |
A Timestamp structure that contains a date and local time when the transition from standard time |
7544 |
to daylight saving time occurs on this operating system. |
|
7545 |
If the time zone does not support daylight saving time or if the caller needs to disable daylight |
|
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7546 |
saving time, this entry is nil. |
13891 | 7547 |
If this date is specified, the StandardDate member in this structure must also be specified. |
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7548 |
Otherwise, the system assumes the time zone data is invalid and no changes will be applied. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7549 |
|
13891 | 7550 |
To select the correct day in the month, set the wYear member to zero, the wHour and wMinute members to |
7551 |
the transition time, the wDayOfWeek member to the appropriate weekday, and the wDay member to indicate |
|
7552 |
the occurrence of the day of the week within the month (1 to 5, where 5 indicates the final occurrence |
|
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7553 |
during the month if that day of the week does not occur 5 times). |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7554 |
|
13891 | 7555 |
If the wYear member is not zero, the transition date is absolute; it will only occur one time. |
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7556 |
Otherwise, it is a relative date that occurs yearly. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7557 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7558 |
DaylightBias |
13891 | 7559 |
The bias value to be used during local time translations that occur during daylight saving time. |
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7560 |
This member is ignored if a value for the DaylightDate member is not supplied. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7561 |
|
13891 | 7562 |
This value is added to the value of the Bias member to form the bias used during daylight saving time. |
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7563 |
In most time zones, the value of this member is -60 |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7564 |
" |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7565 |
! ! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7566 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7567 |
!AbstractOperatingSystem::TimeZoneInfo methodsFor:'accessing'! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7568 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7569 |
bias |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7570 |
^ bias |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7571 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7572 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7573 |
bias:something |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7574 |
bias := something. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7575 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7576 |
|
13891 | 7577 |
bias:biasArg name:nameArg standardBias:standardBiasArg daylightName:daylightNameArg daylightBias:daylightBiasArg |
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7578 |
bias := biasArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7579 |
name := nameArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7580 |
standardBias := standardBiasArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7581 |
daylightName := daylightNameArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7582 |
daylightBias := daylightBiasArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7583 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7584 |
|
13891 | 7585 |
bias:biasArg name:nameArg standardDate:standardDateArg standardBias:standardBiasArg daylightName:daylightNameArg daylightDate:daylightDateArg daylightBias:daylightBiasArg |
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7586 |
bias := biasArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7587 |
name := nameArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7588 |
standardDate := standardDateArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7589 |
standardBias := standardBiasArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7590 |
daylightName := daylightNameArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7591 |
daylightDate := daylightDateArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7592 |
daylightBias := daylightBiasArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7593 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7594 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7595 |
daylightBias |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7596 |
^ daylightBias |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7597 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7598 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7599 |
daylightBias:something |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7600 |
daylightBias := something. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7601 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7602 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7603 |
daylightDay |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7604 |
^ daylightDay |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7605 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7606 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7607 |
daylightDay:something |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7608 |
daylightDay := something. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7609 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7610 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7611 |
daylightHour |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7612 |
^ daylightHour |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7613 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7614 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7615 |
daylightHour:something |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7616 |
daylightHour := something. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7617 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7618 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7619 |
daylightMinute |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7620 |
^ daylightMinute |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7621 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7622 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7623 |
daylightMinute:something |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7624 |
daylightMinute := something. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7625 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7626 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7627 |
daylightMonth |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7628 |
^ daylightMonth |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7629 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7630 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7631 |
daylightMonth:something |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7632 |
daylightMonth := something. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7633 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7634 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7635 |
daylightName |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7636 |
^ daylightName |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7637 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7638 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7639 |
daylightName:something |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7640 |
daylightName := something. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7641 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7642 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7643 |
daylightWeekDay |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7644 |
^ daylightWeekDay |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7645 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7646 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7647 |
daylightWeekDay:something |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7648 |
daylightWeekDay := something. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7649 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7650 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7651 |
daylightYear |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7652 |
^ daylightYear |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7653 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7654 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7655 |
daylightYear:something |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7656 |
daylightYear := something. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7657 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7658 |
|
13891 | 7659 |
daylightYear:daylightYearArg daylightMonth:daylightMonthArg daylightDay:daylightDayArg daylightWeekDay:daylightWeekDayArg daylightHour:daylightHourArg daylightMinute:daylightMinuteArg |
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7660 |
daylightYear := daylightYearArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7661 |
daylightMonth := daylightMonthArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7662 |
daylightDay := daylightDayArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7663 |
daylightWeekDay := daylightWeekDayArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7664 |
daylightHour := daylightHourArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7665 |
daylightMinute := daylightMinuteArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7666 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7667 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7668 |
name |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7669 |
^ name |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7670 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7671 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7672 |
name:something |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7673 |
name := something. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7674 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7675 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7676 |
standardBias |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7677 |
^ standardBias |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7678 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7679 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7680 |
standardBias:something |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7681 |
standardBias := something. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7682 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7683 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7684 |
standardDay |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7685 |
^ standardDay |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7686 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7687 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7688 |
standardDay:something |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7689 |
standardDay := something. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7690 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7691 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7692 |
standardHour |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7693 |
^ standardHour |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7694 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7695 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7696 |
standardHour:something |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7697 |
standardHour := something. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7698 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7699 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7700 |
standardMinute |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7701 |
^ standardMinute |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7702 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7703 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7704 |
standardMinute:something |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7705 |
standardMinute := something. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7706 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7707 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7708 |
standardMonth |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7709 |
^ standardMonth |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7710 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7711 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7712 |
standardMonth:something |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7713 |
standardMonth := something. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7714 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7715 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7716 |
standardWeekDay |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7717 |
^ standardWeekDay |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7718 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7719 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7720 |
standardWeekDay:something |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7721 |
standardWeekDay := something. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7722 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7723 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7724 |
standardYear |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7725 |
^ standardYear |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7726 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7727 |
|
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7728 |
standardYear:something |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7729 |
standardYear := something. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7730 |
! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7731 |
|
13891 | 7732 |
standardYear:standardYearArg standardMonth:standardMonthArg standardDay:standardDayArg standardWeekDay:standardWeekDayArg standardHour:standardHourArg standardMinute:standardMinuteArg |
11843
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7733 |
standardYear := standardYearArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7734 |
standardMonth := standardMonthArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7735 |
standardDay := standardDayArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7736 |
standardWeekDay := standardWeekDayArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7737 |
standardHour := standardHourArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7738 |
standardMinute := standardMinuteArg. |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7739 |
! ! |
b5bd41fe1e8f
timeZoneInfo & utcOffset stuff added
Claus Gittinger <cg@exept.de>
parents:
11835
diff
changeset
|
7740 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
7741 |
!AbstractOperatingSystem class methodsFor:'documentation'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
7742 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
7743 |
version |
18639
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
7744 |
^ '$Header$' |
12543
0ccfdbd164d6
changed: #platformDefineForPlatformName:
Stefan Vogel <sv@exept.de>
parents:
11846
diff
changeset
|
7745 |
! |
0ccfdbd164d6
changed: #platformDefineForPlatformName:
Stefan Vogel <sv@exept.de>
parents:
11846
diff
changeset
|
7746 |
|
0ccfdbd164d6
changed: #platformDefineForPlatformName:
Stefan Vogel <sv@exept.de>
parents:
11846
diff
changeset
|
7747 |
version_CVS |
18639
3529a684d3fb
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
18364
diff
changeset
|
7748 |
^ '$Header$' |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
7749 |
! ! |
6772 | 7750 |
|
14604
cc6062243652
class: AbstractOperatingSystem
Claus Gittinger <cg@exept.de>
parents:
14574
diff
changeset
|
7751 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
7752 |
AbstractOperatingSystem initialize! |