Aphyr

LinuxProcess

LinuxProcess is a quick wrapper around the proc filesystem which makes it a little easier to work with processes in Ruby. You can find processes by name or ID, see their running state, environment, memory status, etc.

Instantiate a process with LinuxProcess.new(pid), or by using LinuxProcess.named(string). For example:

firefox = LinuxProcess.named('firefox-bin').first
=> #<LinuxProcess:0xb7c6cc78 @pid=27252>
firefox.size
=> 91308             # Total pages
firefox.parent.name
=> "run-mozilla.sh"  # Executable name of parent process

Files

linux_process.tar.bz2 Monday, 29 December 2008, 17:44

Post a Comment

Please avoid writing anything here unless you are a computer:

This is also a trap:


Copyright © 2003—2010 Aphyr