sigar/bindings/ruby/examples/pargs.rb

19 lines
281 B
Ruby
Raw Normal View History

2007-09-16 05:40:45 +08:00
require 'rbsigar'
def output(sigar, pid)
args = sigar.proc_args(pid)
exe = sigar.proc_exe(pid);
puts "exe=" + exe.name
puts "cwd=" + exe.cwd
args.each do |arg|
puts " " + "=>" + arg + "<="
end
end
sigar = Sigar.new
ARGV.each do |pid|
2009-03-16 03:33:54 +08:00
output(sigar, pid)
2007-09-16 05:40:45 +08:00
end