ExternalStream.st
branchjv
changeset 20342 219a5a47e8b1
parent 20244 20922299fd44
parent 20270 d2c92e7e2294
child 20360 489fe00f7820
--- a/ExternalStream.st	Sat Aug 13 06:52:18 2016 +0200
+++ b/ExternalStream.st	Tue Aug 23 09:54:28 2016 +0100
@@ -1872,20 +1872,20 @@
 !
 
 reportOn:anErrorSymbolOrNumber
-    "an error occured.
+    "an error occurred.
      Report it via an Exception"
 
     anErrorSymbolOrNumber isInteger ifTrue:[
-	StreamError
-	    raiseRequestWith:anErrorSymbolOrNumber
-	    errorString:(' - os error:' , (OperatingSystem errorTextForNumber:anErrorSymbolOrNumber))
+        StreamError
+            raiseRequestWith:anErrorSymbolOrNumber
+            errorString:(' - os error:' , (OperatingSystem errorTextForNumber:anErrorSymbolOrNumber))
     ].
     (self respondsTo:anErrorSymbolOrNumber) ifTrue:[
-	self perform:anErrorSymbolOrNumber
+        self perform:anErrorSymbolOrNumber
     ] ifFalse:[
-	StreamError
-	    raiseRequestWith:anErrorSymbolOrNumber
-	    errorString:(' - ' , anErrorSymbolOrNumber printString)
+        StreamError
+            raiseRequestWith:anErrorSymbolOrNumber
+            errorString:(' - ' , anErrorSymbolOrNumber printString)
     ].
     ^ false
 ! !
@@ -2371,7 +2371,7 @@
 !
 
 ioError
-    "report an error, that some I/O error occured.
+    "report an error, that some I/O error occurred.
      (for example, a device-IO-error, or reading an NFS-dir,
      which is no longer available and has been mounted soft)"
 
@@ -2383,17 +2383,17 @@
 !
 
 ioError:errorNumber
-    "report an error, that some I/O error occured.
+    "report an error, that some I/O error occurred.
      (for example, a device-IO-error, or reading an NFS-dir,
      which is no longer available and has been mounted soft)"
 
     "{ Pragma: +optSpace }"
 
     ^ StreamIOError newException
-	errorCode:errorNumber;
-	osErrorHolder:(OperatingSystem errorHolderForNumber:errorNumber);
-	parameter:self;
-	raiseRequest
+        errorCode:errorNumber;
+        osErrorHolder:(OperatingSystem errorHolderForNumber:errorNumber);
+        parameter:self;
+        raiseRequest
 
     "Modified: / 8.5.1999 / 20:12:16 / cg"
 !
@@ -2453,7 +2453,7 @@
 !
 
 readError
-    "report an error, that some read error occured"
+    "report an error, that some read error occurred"
 
     "{ Pragma: +optSpace }"
 
@@ -2461,19 +2461,19 @@
 !
 
 readError:errorNumber
-    "report an error, that some read error occured"
+    "report an error, that some read error occurred"
 
     "{ Pragma: +optSpace }"
 
     ^ ReadError newException
-	errorCode:errorNumber;
-	osErrorHolder:(OperatingSystem errorHolderForNumber:errorNumber);
-	parameter:self;
-	raiseRequest
+        errorCode:errorNumber;
+        osErrorHolder:(OperatingSystem errorHolderForNumber:errorNumber);
+        parameter:self;
+        raiseRequest
 !
 
 writeError
-    "report an error, that some write error occured"
+    "report an error, that some write error occurred"
 
     "{ Pragma: +optSpace }"
 
@@ -2481,15 +2481,15 @@
 !
 
 writeError:errorNumber
-    "report an error, that some write error occured"
+    "report an error, that some write error occurred"
 
     "{ Pragma: +optSpace }"
 
     ^ WriteError newException
-	errorCode:errorNumber;
-	osErrorHolder:(OperatingSystem errorHolderForNumber:errorNumber);
-	parameter:self;
-	raiseRequest
+        errorCode:errorNumber;
+        osErrorHolder:(OperatingSystem errorHolderForNumber:errorNumber);
+        parameter:self;
+        raiseRequest
 ! !
 
 !ExternalStream methodsFor:'finalization'!
@@ -5686,7 +5686,7 @@
 !
 
 gotErrorOrEOF
-    "answerv true, if amn error or eof has been occured on the stream"
+    "answerv true, if amn error or eof has been occurred on the stream"
 
     ^ hitEOF == true or:[lastErrorNumber notNil]
 !
@@ -5763,7 +5763,7 @@
     "suspend the current process, until the receiver
      becomes ready for reading or a timeout (in milliseconds) expired.
      If data is already available, return immediate.
-     Return true if a timeout occured (i.e. false, if data is available).
+     Return true if a timeout occurred (i.e. false, if data is available).
      The other threads are not affected by the wait."
 
     |fd inputSema hasTimedout wasBlocked|
@@ -5809,14 +5809,14 @@
 readWriteWaitWithTimeoutMs:timeout
     "suspend the current process, until the receiver
      becomes ready for reading or writing or a timeout (in milliseconds) expired.
-     Return true if a timeout occured (i.e. false, if data is available).
+     Return true if a timeout occurred (i.e. false, if data is available).
      Return immediate if the receiver is already ready.
      The other threads are not affected by the wait."
 
     |fd sema hasTimedout wasBlocked|
 
     handle isNil ifTrue:[
-	^ self errorNotOpen
+        ^ self errorNotOpen
     ].
 
     fd := self fileDescriptor.
@@ -5825,20 +5825,20 @@
     wasBlocked := OperatingSystem blockInterrupts.
     sema := Semaphore new name:'readWriteWait'.
     [
-	timeout notNil ifTrue:[
-	    Processor signal:sema afterMilliseconds:timeout
-	].
-	Processor signal:sema onOutput:fd.
-	Processor signal:sema onInput:fd.
-	Processor activeProcess state:#ioWait.
-	sema wait.
-	hasTimedout := timeout notNil and:[(OperatingSystem readWriteCheck:fd) not].
+        timeout notNil ifTrue:[
+            Processor signal:sema afterMilliseconds:timeout
+        ].
+        Processor signal:sema onOutput:fd.
+        Processor signal:sema onInput:fd.
+        Processor activeProcess state:#ioWait.
+        sema wait.
+        hasTimedout := timeout notNil and:[(OperatingSystem readWriteCheck:fd) not].
     ] ifCurtailed:[
-	Processor disableSemaphore:sema.
-	wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
+        Processor disableSemaphore:sema.
+        wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
     ].
     timeout notNil ifTrue:[
-	Processor disableSemaphore:sema.
+        Processor disableSemaphore:sema.
     ].
     wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
     ^ hasTimedout
@@ -5847,14 +5847,14 @@
 writeExceptionWaitWithTimeoutMs:timeout
     "suspend the current process, until the receiver
      becomes ready for reading or writing or a timeout (in milliseconds) expired.
-     Return true if a timeout occured (i.e. false, if data is available).
+     Return true if a timeout occurred (i.e. false, if data is available).
      Return immediate if the receiver is already ready.
      The other threads are not affected by the wait."
 
     |fd sema hasTimedout wasBlocked|
 
     handle isNil ifTrue:[
-	^ self errorNotOpen
+        ^ self errorNotOpen
     ].
 
     fd := self fileDescriptor.
@@ -5863,20 +5863,20 @@
     wasBlocked := OperatingSystem blockInterrupts.
     sema := Semaphore new name:'writeExceptionWait'.
     [
-	timeout notNil ifTrue:[
-	    Processor signal:sema afterMilliseconds:timeout
-	].
-	Processor signal:sema onOutput:fd.
-	Processor signal:sema onException:fd.
-	Processor activeProcess state:#ioWait.
-	sema wait.
-	hasTimedout := timeout notNil and:[(OperatingSystem readWriteCheck:fd) not].
+        timeout notNil ifTrue:[
+            Processor signal:sema afterMilliseconds:timeout
+        ].
+        Processor signal:sema onOutput:fd.
+        Processor signal:sema onException:fd.
+        Processor activeProcess state:#ioWait.
+        sema wait.
+        hasTimedout := timeout notNil and:[(OperatingSystem readWriteCheck:fd) not].
     ] ifCurtailed:[
-	Processor disableSemaphore:sema.
-	wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
+        Processor disableSemaphore:sema.
+        wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
     ].
     timeout notNil ifTrue:[
-	Processor disableSemaphore:sema.
+        Processor disableSemaphore:sema.
     ].
     wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
     ^ hasTimedout
@@ -5885,17 +5885,17 @@
 writeWaitWithTimeoutMs:timeout
     "suspend the current process, until the receiver
      becomes ready for writing or a timeout (in milliseconds) expired.
-     Return true if a timeout occured (i.e. false, if data is available).
+     Return true if a timeout occurred (i.e. false, if data is available).
      Return immediate if the receiver is already ready.
      The other threads are not affected by the wait."
 
     |fd outputSema hasTimedout wasBlocked|
 
     handle isNil ifTrue:[
-	^ self errorNotOpen
+        ^ self errorNotOpen
     ].
     mode == #readonly ifTrue:[
-	^ self errorReadOnly
+        ^ self errorReadOnly
     ].
 
     fd := self fileDescriptor.
@@ -5904,19 +5904,19 @@
     wasBlocked := OperatingSystem blockInterrupts.
     outputSema := Semaphore new name:'writeWait'.
     [
-	timeout notNil ifTrue:[
-	    Processor signal:outputSema afterMilliseconds:timeout
-	].
-	Processor signal:outputSema onOutput:fd.
-	Processor activeProcess state:#ioWait.
-	outputSema wait.
-	hasTimedout := timeout notNil and:[(OperatingSystem writeCheck:fd) not].
+        timeout notNil ifTrue:[
+            Processor signal:outputSema afterMilliseconds:timeout
+        ].
+        Processor signal:outputSema onOutput:fd.
+        Processor activeProcess state:#ioWait.
+        outputSema wait.
+        hasTimedout := timeout notNil and:[(OperatingSystem writeCheck:fd) not].
     ] ifCurtailed:[
-	Processor disableSemaphore:outputSema.
-	wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
+        Processor disableSemaphore:outputSema.
+        wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
     ].
     timeout notNil ifTrue:[
-	Processor disableSemaphore:outputSema.
+        Processor disableSemaphore:outputSema.
     ].
     wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
     ^ hasTimedout
@@ -6364,10 +6364,10 @@
 
 nextPutAll:initialWriteCount from:buffer startingAt:initialOffset
     "redefined, to wait until stream is writable, to avoid blocking in a write.
-     I don't know how to write non-bytes to a external stream, but let superclass handle this."
+     I don't know how to write non-bytes to an external stream, but let superclass handle this."
 
     buffer isByteCollection ifTrue:[
-	^ self nextPutBytes:initialWriteCount from:buffer startingAt:initialOffset.
+        ^ self nextPutBytes:initialWriteCount from:buffer startingAt:initialOffset.
     ].
 
     ^ super nextPutAll:initialWriteCount from:buffer startingAt:initialOffset