ExternalStreamMonitor.st
changeset 19544 bbbf9596c29f
parent 19344 2d2c733c4665
--- a/ExternalStreamMonitor.st	Tue Mar 03 12:23:09 2020 +0100
+++ b/ExternalStreamMonitor.st	Wed Mar 04 17:00:14 2020 +0100
@@ -307,7 +307,7 @@
 updateStatus:newStreamsList
     "update status display of streams"
 
-    |numberOfHeadlines oldList list oldSelection newSelection|
+    |numberOfHeadlines oldList list oldSelection newSelection handlePadding|
 
     shown ifTrue:[
         numberOfHeadlines := self numberOfHeadlines.
@@ -372,30 +372,25 @@
                         ].    
                     ].
                 ].
-                
-                OperatingSystem isMSWINDOWSlike ifTrue:[
-                    aStream isOpen ifTrue:[
-                        handle := aStream fileHandle.
-                        handle isInteger ifTrue:[
-                            handleString := handle printString
-                        ] ifFalse:[
-                            handleString := (handle address ? 0) hexPrintString
-                        ].
+
+                handleString := ''.
+                aStream isOpen ifTrue:[
+                    handle := aStream fileHandle.
+                    handle isExternalAddress ifTrue:[
+                        handleString := (handle address ? 0) hexPrintString
+                    ] ifFalse:[
+                        handleString := handle printString
                     ].
-                    handleString := (handleString ? '') leftPaddedTo:7
+                ].
+                OperatingSystem isMSWINDOWSlike ifTrue:[
+                    handlePadding := 7.
                 ] ifFalse:[
-                    aStream isOpen ifTrue:[
-                        [
-                            handleString := aStream fileDescriptor printString
-                        ] on:StreamError do:[
-                        ].    
-                    ].
-                    handleString := (handleString ? '') leftPaddedTo:3
+                    handlePadding := 3.
                 ].
 
                 line := (type contractTo:30) paddedTo:30.
                 line := line , ' ' , (((globalNameOrNil ? '') contractTo:30) paddedTo:30).
-                line := line , ' ' , handleString.
+                line := line , ' ' , handleString leftPaddedTo:handlePadding.
                 line := line , ' ' , (detail ? '').
 
                 isOpen := aStream isOpen.
@@ -448,6 +443,7 @@
 
     "Modified: / 11-10-2017 / 13:56:14 / cg"
     "Modified: / 07-06-2019 / 22:10:36 / Claus Gittinger"
+    "Modified: / 04-03-2020 / 14:48:45 / Stefan Vogel"
 ! !
 
 !ExternalStreamMonitor methodsFor:'menu'!