method

pid

v1_8_6_287 - Show latest stable - Class: IO
pid()
public

Returns the process ID of a child process associated with ios. This will be set by IO::popen.

   pipe = IO.popen("-")
   if pipe
     $stderr.puts "In parent, child pid is #{pipe.pid}"
   else
     $stderr.puts "In child, pid is #{$$}"
   end

produces:

   In child, pid is 26209
   In parent, child pid is 26209