--- a/AbstractOperatingSystem.st Wed May 19 12:35:31 1999 +0200
+++ b/AbstractOperatingSystem.st Wed May 19 12:39:07 1999 +0200
@@ -37,48 +37,44 @@
documentation
"
- this class realizes access to most (all ?) required operating system services;
- some of it is very specific for unix, so do not depend on
- things available here in your applications
- - some may not be found in other OS's or be slightly different ...
-
- (On the other hand: I do not want to hide all features
- from you - in some situations it MAY be interesting to be
- able to get down to a select or fork system call easily (at least on Unix systems).
- You decide - portability vs. functionality)
+ this class realizes services common to the supported operating systems;
+ typically, services which can be implemented based upon more primitive
+ functions, or which can be implemented in a portable way (but probably
+ less performant) are implemented here.
[Class variables:]
-
- LastErrorNumber <Integer> the last value of errno
-
- OSSignals <Array> Array of signals to be raised for corresponding
- OperatingSystem signals.
-
- PipeFailed <Boolean> set if a fork (or popen) has failed;
- ST/X will avoid doing more forks/popens
- if this flag is set, for a slightly
- smoother operation.
-
- ErrorSignal <Signal> Parentsignal of all OS error signals.
- not directly raised.
-
- AccessDeniedErrorSignal misc concrete error reporting signals
- FileNotFoundErrorSignal
- UnsupportedOperationSignal
- InvalidArgumentsSignal
-
- LocaleInfo <Dictionary> if non nil, that is taken instead of the operating
- systems locale definitions (allows for overwriting
- these, or provide a compatible info on systems which do
- not support locales)
+ ConcreteClass <Class> the real OS class
+
+ LocaleInfo <Dictionary> if non nil, that is taken instead of the operating
+ systems locale definitions (allows for overwriting
+ these, or provide a compatible info on systems which do
+ not support locales)
+
+ LastErrorNumber <Integer> the last value of errno
+
+ OSSignals <Array> Array of signals to be raised for corresponding
+ OperatingSystem signals.
+
+ PipeFailed <Boolean> set if a fork (or popen) has failed;
+ ST/X will avoid doing more forks/popens
+ if this flag is set, for a slightly
+ smoother operation.
+
+ ErrorSignal <Signal> Parentsignal of all OS error signals.
+ not directly raised.
+
+ AccessDeniedErrorSignal misc concrete error reporting signals
+ FileNotFoundErrorSignal
+ UnsupportedOperationSignal
+ InvalidArgumentsSignal
[author:]
- Claus Gittinger
+ Claus Gittinger
[see also:]
- OSProcessStatus
- Filename Date Time
- ExternalStream FileStream PipeStream Socket
+ OSProcessStatus
+ Filename Date Time
+ ExternalStream FileStream PipeStream Socket
"
!
@@ -1260,24 +1256,24 @@
|result|
- PipeFailed ifFalse:[
- PipeStream openErrorSignal handle:[:ex |
- PipeFailed := true.
- 'OperatingSystem [warning]: cannot fork/popen' errorPrintCR.
- ex return.
- ] do:[
- |p|
-
- p := PipeStream readingFrom:aCommand.
- p notNil ifTrue:[
- result := p nextLine.
- p close
- ].
- ].
+ PipeFailed ~~ true ifTrue:[
+ PipeStream openErrorSignal handle:[:ex |
+ PipeFailed := true.
+ 'OperatingSystem [warning]: cannot fork/popen' errorPrintCR.
+ ex return.
+ ] do:[
+ |p|
+
+ p := PipeStream readingFrom:aCommand.
+ p notNil ifTrue:[
+ result := p nextLine.
+ p close
+ ].
+ ].
].
^ result
- "Modified: 10.1.1997 / 18:00:07 / cg"
+ "Modified: / 19.5.1999 / 12:34:28 / cg"
!
getVMSSymbol:aSymbolString
@@ -1510,10 +1506,10 @@
Here, false is returned and the caller should be prepared
for a fallBack solution.
Notice:
- this is not a public interface; instead, it is used
- internally by the Filename class, to try a fast copy
- before doing things manually.
- Please use Filename recursiveCopyTo:"
+ this is not a public interface; instead, it is used
+ internally by the Filename class, to try a fast copy
+ before doing things manually.
+ Please use Filename recursiveCopyTo:"
^ false
@@ -1552,10 +1548,10 @@
Here, false is returned and the caller should be prepared
for a fallBack solution.
Notice:
- this is not a public interface; instead, it is used
- internally by the Filename class, to try a fast remove
- before doing things manually.
- Please use Filename recursiveRemoveDirectory:"
+ this is not a public interface; instead, it is used
+ internally by the Filename class, to try a fast remove
+ before doing things manually.
+ Please use Filename recursiveRemoveDirectory:"
^ false
@@ -1779,13 +1775,21 @@
"/ root, home and current directories.
"/
^ Array
- with:'/'
- with:(self getHomeDirectory)
- with:(Filename currentDirectory pathName)
+ with:'/'
+ with:(self getHomeDirectory)
+ with:(Filename currentDirectory pathName)
"Modified: / 5.5.1999 / 01:06:26 / cg"
!
+getNullDevice
+ "get the name of the null-device. Nil is returned if not supported"
+
+ ^ nil
+
+ "Created: / 19.5.1999 / 12:24:59 / cg"
+!
+
idOf:aPathName
"return the fileNumber (i.e. inode number) of a file.
@@ -1965,6 +1969,42 @@
^ ''
! !
+!AbstractOperatingSystem class methodsFor:'interprocess communication'!
+
+createCOMFileForVMSCommand:aCommandString in:aDirectory
+ ^ UnsupportedOperationSignal raiseErrorString:'not supported on this platform'
+
+ "Modified: / 19.5.1999 / 12:16:04 / cg"
+ "Created: / 19.5.1999 / 12:16:31 / cg"
+!
+
+createMailBox
+ ^ UnsupportedOperationSignal raiseErrorString:'not supported on this platform'
+
+ "Created: / 19.5.1999 / 12:14:56 / cg"
+ "Modified: / 19.5.1999 / 12:16:04 / cg"
+!
+
+destroyMailBox:mbx
+ ^ UnsupportedOperationSignal raiseErrorString:'not supported on this platform'
+
+ "Modified: / 19.5.1999 / 12:16:04 / cg"
+ "Created: / 19.5.1999 / 12:16:43 / cg"
+!
+
+mailBoxNameOf:mbx
+ ^ UnsupportedOperationSignal raiseErrorString:'not supported on this platform'
+
+ "Created: / 19.5.1999 / 12:14:56 / cg"
+ "Modified: / 19.5.1999 / 12:16:08 / cg"
+!
+
+makePipe
+ ^ UnsupportedOperationSignal raiseErrorString:'not supported on this platform'
+
+ "Modified: / 19.5.1999 / 12:15:58 / cg"
+! !
+
!AbstractOperatingSystem class methodsFor:'interrupts & signals'!
blockInterrupts
@@ -2273,14 +2313,14 @@
startSpyTimer
"trigger a spyInterrupt, to be signalled after some short (virtual) time.
- This is used by the old MessageTally for profiling.
- Should be changed to use real profiling timer if available.
+ Return true, if the spy-timerInterrupt was enabled.
+ This was used by the old MessageTally for profiling.
On systems, where no virtual timer is available, use the real timer
(which is of course less correct).
OBSOLETE: the new messageTally runs as a high prio process, not using
spy interrupts."
- self subclassResponsibility
+ ^ false
!
stopSpyTimer
@@ -2288,7 +2328,7 @@
OBSOLETE: the new messageTally runs as a high prio process, not using
spy interrupts."
- self subclassResponsibility
+ ^ false
!
terminateProcess:processId
@@ -3073,18 +3113,18 @@
homePath notNil ifTrue:[
sysPath add:homePath.
- "/
- "/ a users private smalltalk directory in its home (login) directory
- "/
- OperatingSystem isUNIXlike ifTrue:[
+ "/
+ "/ a users private smalltalk directory in its home (login) directory
+ "/
+ OperatingSystem isUNIXlike ifTrue:[
priv := '.smalltalk'.
- ] ifFalse:[
+ ] ifFalse:[
priv := 'smalltalk'.
- ].
+ ].
userPrivateSTXDir := homePath asFilename constructString:priv.
- (userPrivateSTXDir asFilename isDirectory) ifTrue:[
+ (userPrivateSTXDir asFilename isDirectory) ifTrue:[
sysPath add:userPrivateSTXDir
- ].
+ ].
].
"/
@@ -3713,6 +3753,6 @@
!AbstractOperatingSystem class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/AbstractOperatingSystem.st,v 1.17 1999-05-05 12:54:53 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/AbstractOperatingSystem.st,v 1.18 1999-05-19 10:39:07 cg Exp $'
! !
AbstractOperatingSystem initialize!