Lars Christensen
1/8/2008 12:42:00 PM
On Jan 8, 12:36 pm, Junkone <junko...@gmail.com> wrote:
> I need to get list of processes running on windows with process names
> and pids. is there any api that will do it. i was looking at win32/
> process and could not fidn a function that will provide list of
> existing running processes.
Try sys/proctable:
irb(main):002:0> require 'sys/proctable'
=> false
irb(main):002:0> require 'time' # dependency of sys/proctable
=> false
irb(main):003:0> Sys::ProcTable.ps.find { |p| p.name ==
"ruby.exe" }.pid
=> 600
Lars