Method: LinuxStat::Process.list

Defined in:
lib/linux_stat/process.rb

.listObject

Returns the list of processes from /proc/.

The return type is an Array of Integers.



8
9
10
11
12
13
# File 'lib/linux_stat/process.rb', line 8

def list
  Dir['/proc/*'].select { |x|
    pid = File.split(x)[1]
    pid.to_i.to_s == pid
  }.map! { |x| File.split(x)[-1].to_i }
end