From: Roger Pack Date: 2012-09-15T08:29:33+09:00 Subject: Re: IO#popen and exit status >> not work either. I think io.close does already all the cleanup. > > $? can be used after close. > > I hope this documentation helps. Just so there is no confusion for others that run into this since google brought me straight here, you can do: a = IO.popen(process) a.close and $? will be set immediately after the call to close succeeds. Process.waitpid is not necessary. -- Posted via http://www.ruby-forum.com/.