Provides a list of currently executed process.
Class ProcessEnum
This class can be used to retreive a list of running processes on the host machine, with minimal informations for each of them as its name and an unique ID by which it can be identified later on. ProcessEnum constructor returns an object that can be iterated upon like in the following example.
enum = ProcessEnum() while enum.next() > enum.name, ":", enum.pid, "( child of ", enum.parentPid, ")" end
The next() method will fill the object properties with the data of a new element, until it returns false.
Properties | |
cmdLine | Complete path of the program that started the process. |
name | Symbolic name of the process. |
parentPid | ID of the process that created this process. |
pid | ID (usually numeric) identifying a process in the system; this value can be directly fed as a parameter for function accepting process IDs. |
Methods | |
close | Closes the enumeration freeing system resources. |
next | Fills the properties of this class with the next entry in the process table. |
Complete path of the program that started the process.
Complete path of the program that started the process. Not always available, and not provided by all systems.
Symbolic name of the process.
Symbolic name of the process.
ID of the process that created this process.
ID of the process that created this process. The parent PID always represents an existing process, but it's possible that children are returned before the parent is listed.
ID (usually numeric) identifying a process in the system; this value can be directly fed as a parameter for function accepting process IDs.
ID (usually numeric) identifying a process in the system; this value can be directly fed as a parameter for function accepting process IDs.
Closes the enumeration freeing system resources.
ProcessEnum.close()
Disposes the data associated with this item without waiting for the garbage collector to reclaim them.
Fills the properties of this class with the next entry in the process table.
ProcessEnum.next()
Return | True if there is an element that will fill the properties, false if the element enumeration terminated. | ||
Raise |
|
Fills the properties of the class with data from the next element in the process enumeration. If the previous one was the last entry, the method returns false, else it returns true and the properties are changed.