--- a/OSProcess.st Mon Jul 16 12:54:33 2018 +0200
+++ b/OSProcess.st Tue Jul 17 09:30:15 2018 +0200
@@ -310,14 +310,36 @@
ProcessListEntry executableName:executableName processID:processID sessionName:userName
]
as:OrderedCollection.
- ^ entries
] ifFalse:[
- ^ #()
+ lines := (PipeStream outputFromCommand:'ps') asStringCollection.
+ sepIdx := lines findFirst:[:line | line withoutSeparators first isDigit].
+ sepIdx == 0 ifTrue:[ ^ #() ].
+ entries := (lines from:(sepIdx + 1))
+ collect:[:line |
+ |s idx executableName processID tty time|
+
+ s := line readStream.
+ processID := Integer readFrom:s.
+ s skipSeparators.
+ tty := s upToSeparator.
+ s skipSeparators.
+ time := s upToSeparator.
+ s skipSeparators.
+ executableName := s upToEnd.
+ (executableName startsWith:'-') ifTrue:[
+ executableName := executableName copyFrom:2.
+ ].
+ ProcessListEntry executableName:executableName processID:processID sessionName:nil
+ ]
+ as:OrderedCollection.
].
+ ^ entries
"
self getTaskList
"
+
+ "Modified: / 16-07-2018 / 23:11:05 / Claus Gittinger"
! !
!OSProcess methodsFor:'accessing'!