Windoze/ruby/signals - egads!

anyone understand why this just dumps EINVAL errors on windoze?

cat:~ > cat a.rb
program = <<-ruby
puts $$

require ‘logger’
logger = Logger.new STDERR
Signal.list.keys.each do |sig|
begin
trap sig do
puts(“trap: %s” % sig)
end
rescue Exception => e
logger.info{ e }
end
end
ruby

require ‘logger’
logger = Logger.new STDERR
pipe = IO.popen ‘ruby’, ‘r+’
pipe.puts program
pipe.close_write
pid = pipe.gets.strip.to_i
puts pid

Signal.list.keys.each do |sig|
next if sig == ‘KILL’
begin
STDERR.puts “#{ sig } => #{ pid }”
Process.kill sig, pid
rescue Exception => e
logger.info{ e }
end
end

of course i can send ‘KILL’, but every other signal simply raises
EINVAL?? works fine on other platforms…

cheers.

a @ http://codeforpeople.com/

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs