added bin: lsps

This commit is contained in:
2023-05-23 14:51:56 +02:00
parent e73b4c4d14
commit c4260aa719
3 changed files with 28 additions and 1 deletions

21
src/bin/LSPS.hx Normal file
View File

@@ -0,0 +1,21 @@
package bin;
import kernel.ps.ProcessManager;
import kernel.ps.ProcessHandle;
import kernel.ps.Process;
class LSPS implements Process {
public function new() {}
public function run(handle:ProcessHandle) {
var pids = ProcessManager.listProcesses();
handle.writeLine('Count: ${pids.length}');
for (pid in pids) {
handle.writeLine('${pid}');
}
handle.close();
}
}