PipeStream.st
changeset 20031 8de79de4b866
parent 19860 324edacff5cc
child 20079 8d884971c2ed
child 20099 3924a4006e8b
equal deleted inserted replaced
20030:93008997c59e 20031:8de79de4b866
       
     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
   216 
   218 
   217     "
   219     "
   218 	|p|
   220 	|p|
   219 
   221 
   220 	p := PipeStream bidirectionalFor:'cat -u'.
   222 	p := PipeStream bidirectionalFor:'cat -u'.
   221 	p nextPutAll:'Wer ist der Bürgermeister von Wesel'; cr.
   223 	p nextPutAll:'Wer ist der Bürgermeister von Wesel'; cr.
   222 	Transcript showCR:p nextLine.
   224 	Transcript showCR:p nextLine.
   223 	p close
   225 	p close
   224     "
   226     "
   225 
   227 
   226     "
   228     "
   484 !PipeStream methodsFor:'closing'!
   486 !PipeStream methodsFor:'closing'!
   485 
   487 
   486 shutDown
   488 shutDown
   487     "close the Stream and terminate the command"
   489     "close the Stream and terminate the command"
   488 
   490 
   489     self unregisterForFinalization
   491     self unregisterForFinalization.
   490        "terminate first under windows".
       
   491 
   492 
   492     "terminate first under windows"
   493     "terminate first under windows"
   493     OperatingSystem isMSDOSlike ifTrue:[
   494     OperatingSystem isMSDOSlike ifTrue:[
   494 	self terminatePipeCommand.
   495         self terminatePipeCommand.
   495 	self closeFileDescriptor.
   496         self closeFileDescriptor.
   496 	^ self.
   497         ^ self.
   497     ].
   498     ].
   498 
   499 
   499     "terminate last under unix"
   500     "terminate last under unix"
   500     self closeFileDescriptor.
   501     self closeFileDescriptor.
   501     self terminatePipeCommand.
   502     self terminatePipeCommand.