At Wed, 28 Apr 2004 16:08:58 +0900,
Hal Fulton wrote in [ruby-talk:98616]:
No need for a pid
Process.wait
Hmm, but I don’t want to wait for it. I want to make sure the process
dies. I think io.pid may be the way to go.
You don’t need to wait for IO.popen, popen’ed IO waits the
child process at close. However, popen3 spawns child and
grand-child process which the command is executed as, so you
cannot wait the real command. This restriction is to get rid
of leaving a zombie process.
At Wed, 28 Apr 2004 16:08:58 +0900,
Hal Fulton wrote in [ruby-talk:98616]:
No need for a pid
Process.wait
Hmm, but I don’t want to wait for it. I want to make sure the process
dies. I think io.pid may be the way to go.
You don’t need to wait for IO.popen, popen’ed IO waits the
child process at close. However, popen3 spawns child and
grand-child process which the command is executed as, so you
cannot wait the real command. This restriction is to get rid
of leaving a zombie process.
Hmm. … right, I never knew that :D.
irb(main):001:0> f = IO.popen(“fortune”)
=> #IO:0x402be42c
irb(main):002:0> f.read
=> “Do not meddle in the affairs of wizards, for they become soggy and hard to\nlight.\n\nDo not throw cigarette butts in the urinal, for they are subtle and\nquick to anger.\n”