PipeStream.st
changeset 369 730e0f5d2404
parent 362 4131e87e79ec
child 379 5b5a130ccd09
equal deleted inserted replaced
368:a3c21a89ec37 369:730e0f5d2404
    19 
    19 
    20 PipeStream comment:'
    20 PipeStream comment:'
    21 COPYRIGHT (c) 1989 by Claus Gittinger
    21 COPYRIGHT (c) 1989 by Claus Gittinger
    22 	      All Rights Reserved
    22 	      All Rights Reserved
    23 
    23 
    24 $Header: /cvs/stx/stx/libbasic/PipeStream.st,v 1.26 1995-07-22 19:23:52 claus Exp $
    24 $Header: /cvs/stx/stx/libbasic/PipeStream.st,v 1.27 1995-07-28 02:37:38 claus Exp $
    25 '!
    25 '!
    26 
    26 
    27 !PipeStream class methodsFor:'documentation'!
    27 !PipeStream class methodsFor:'documentation'!
    28 
    28 
    29 copyright
    29 copyright
    40 "
    40 "
    41 !
    41 !
    42 
    42 
    43 version
    43 version
    44 "
    44 "
    45 $Header: /cvs/stx/stx/libbasic/PipeStream.st,v 1.26 1995-07-22 19:23:52 claus Exp $
    45 $Header: /cvs/stx/stx/libbasic/PipeStream.st,v 1.27 1995-07-28 02:37:38 claus Exp $
    46 "
    46 "
    47 !
    47 !
    48 
    48 
    49 documentation
    49 documentation
    50 "
    50 "
   243 !
   243 !
   244 
   244 
   245 shutDown
   245 shutDown
   246     "close the Stream, ignoring any broken-pipe errors"
   246     "close the Stream, ignoring any broken-pipe errors"
   247 
   247 
   248     BrokenPipeSignal catch:[self closeFileDescriptor]
   248     BrokenPipeSignal catch:[
       
   249 	Lobby unregister:self.
       
   250 	self closeFileDescriptor
       
   251     ]
   249 !
   252 !
   250 
   253 
   251 closeFile
   254 closeFile
   252     "low level close - redefined since we close a pipe here.
   255     "low level close - redefined since we close a pipe here.
   253      This waits for the command to finish. 
   256      This waits for the command to finish. 
   265 	__BEGIN_INTERRUPTABLE__
   268 	__BEGIN_INTERRUPTABLE__
   266 	pclose(MKFD(fp));
   269 	pclose(MKFD(fp));
   267 	__END_INTERRUPTABLE__
   270 	__END_INTERRUPTABLE__
   268     }
   271     }
   269 #endif
   272 #endif
       
   273 %}
       
   274 !
       
   275 
       
   276 closeFileDescriptor
       
   277     "alternative very low level close 
       
   278      This closes the underlying OS-fileDescriptor 
       
   279      - and will NOT write any buffered data to the stream.
       
   280      You have been warned."
       
   281 
       
   282 %{  /* NOCONTEXT */
       
   283 
       
   284     OBJ fp;
       
   285     FILE *f;
       
   286 
       
   287     if ((fp = _INST(filePointer)) != nil) {
       
   288 	_INST(filePointer) = nil;
       
   289 	__BEGIN_INTERRUPTABLE__
       
   290 	f = MKFD(fp);
       
   291 	close(fileno(f));
       
   292 	__END_INTERRUPTABLE__
       
   293     }
   270 %}
   294 %}
   271 ! !
   295 ! !
   272 
   296 
   273 !PipeStream methodsFor:'private'!
   297 !PipeStream methodsFor:'private'!
   274 
   298