NonPositionableExternalStream.st
changeset 22541 b8acf94e540b
parent 22194 41775bf87e61
child 22702 d347a51bef9c
equal deleted inserted replaced
22540:afb476a2a3d9 22541:b8acf94e540b
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 1989 by Claus Gittinger
     4  COPYRIGHT (c) 1989 by Claus Gittinger
     3 	      All Rights Reserved
     5 	      All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
   300     "report an error, that some write error occurred.
   302     "report an error, that some write error occurred.
   301      Redefined to care for writeErrors on stdout and stderr,
   303      Redefined to care for writeErrors on stdout and stderr,
   302      which happens under linux, if the console is closed while I am running.
   304      which happens under linux, if the console is closed while I am running.
   303      In this case, we ignore the error."
   305      In this case, we ignore the error."
   304 
   306 
   305     ((self == Stderr) or:[self == Stdout]) ifTrue:[
   307 "/ No!! this causes nextPutAll: to loop forever, since there are always bytes remaining
   306         ^ self
   308 "/
   307     ].
   309 "/    ((self == Stderr) or:[self == Stdout]) ifTrue:[
       
   310 "/        ^ self
       
   311 "/    ].
   308     super writeError:errorNumber
   312     super writeError:errorNumber
       
   313 
       
   314     "Modified: / 09-02-2018 / 20:33:30 / stefan"
   309 ! !
   315 ! !
   310 
   316 
   311 !NonPositionableExternalStream methodsFor:'initialization'!
   317 !NonPositionableExternalStream methodsFor:'initialization'!
   312 
   318 
   313 initialize
   319 initialize
   888 
   894 
   889 nextPutAll:aCollection
   895 nextPutAll:aCollection
   890     "nextPutBytes handles non-blocking io in receiver"
   896     "nextPutBytes handles non-blocking io in receiver"
   891 
   897 
   892     self nextPutBytes:aCollection size from:aCollection startingAt:1.
   898     self nextPutBytes:aCollection size from:aCollection startingAt:1.
   893     ^ self.
   899 
       
   900     "Modified: / 09-02-2018 / 19:59:15 / stefan"
   894 !
   901 !
   895 
   902 
   896 nextPutAll:aCollection startingAt:start to:stop
   903 nextPutAll:aCollection startingAt:start to:stop
   897     "redefined, to wait until stream is writable, to avoid blocking in a write"
   904     "redefined, to wait until stream is writable, to avoid blocking in a write"
   898 
   905 
   939         ].
   946         ].
   940     ].
   947     ].
   941     wasBlocking ifTrue:[self blocking:true].
   948     wasBlocking ifTrue:[self blocking:true].
   942 
   949 
   943     ^ offset - initialOffset.
   950     ^ offset - initialOffset.
       
   951 !
       
   952 
       
   953 nextPutLine:aString
       
   954     "write the characters in aString and append an end-of-Line marker
       
   955      (LF, CR or CRLF - depending in the setting of eolMode)"
       
   956 
       
   957     self nextPutAll:aString.
       
   958     self cr.
       
   959 
       
   960     "Created: / 09-02-2018 / 21:13:47 / stefan"
   944 ! !
   961 ! !
   945 
   962 
   946 !NonPositionableExternalStream class methodsFor:'documentation'!
   963 !NonPositionableExternalStream class methodsFor:'documentation'!
   947 
   964 
   948 version
   965 version