2009-07-14から1日間の記事一覧
rubyで書く簡易版pstreeはこんな感じかな。 class PsTree def initialize @line = "-" @space = " " @table = Hash.new{|h,k| h[k] = []} proc_dat end def proc_dat Dir.glob("/proc/[0-9]*") {|dir| stat = stat_open("#{dir}/stat") pid = stat[0]; ppid …
rubyで書く簡易版pstreeはこんな感じかな。 class PsTree def initialize @line = "-" @space = " " @table = Hash.new{|h,k| h[k] = []} proc_dat end def proc_dat Dir.glob("/proc/[0-9]*") {|dir| stat = stat_open("#{dir}/stat") pid = stat[0]; ppid …