moul :: osdependent :: processinfo :: LinuxProcReader :: Class LinuxProcReader
[hide private]
[frames] | no frames]

Class LinuxProcReader



object --+
         |
        LinuxProcReader

Get process informations under Linux by reading /proc

Tested under Linux, may work on other POSIX os with /proc, too.

Instance Methods [hide private]
  getPids(self)
Get a list of pids
  getPidNames(self)
Get a list of pid -> name
  getPidDetails(self, pid)
Get detailed informations about a process
  _readProcStatus(self, pid, searchkey=None)
Read and parse status informations for PID pid
  _readProcCmdline(self, pid)
Read cmdline informations for pid and returns a list similar to sys.argv
  _readProcOther(self, pid)
Read other possible useful things

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__


Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

getPids(self)

 
Get a list of pids

getPidNames(self)

 
Get a list of pid -> name

getPidDetails(self, pid)

 
Get detailed informations about a process

_readProcStatus(self, pid, searchkey=None)

 

Read and parse status informations for PID pid

pid - pid as long or int or 'self'

If searchkey is None the method returns a mapping of lower keys to values (stripped). If searchkey is given than the method immediatly returns the value or returns None if they key can't be found.

_readProcCmdline(self, pid)

 
Read cmdline informations for pid and returns a list similar to sys.argv

_readProcOther(self, pid)

 

Read other possible useful things

cwd -> current work directory (may not exist) exe -> path to executable (may not exist)