Method: LinuxStat::Process.running
- Defined in:
- lib/linux_stat/process.rb
.running ⇒ Object
Returns all the id of processes that are running. The return type is an Array of Integers.
97 98 99 100 101 102 103 104 105 |
# File 'lib/linux_stat/process.rb', line 97 def running list.select { |x| begin IO.read(File.join('/proc', x.to_s, 'stat')).split[2] == ?R rescue Exception nil end } end |