From: Shea Martin Date: 2006-03-23T06:04:19+09:00 Subject: Re: IO#popen and exit status Shea Martin wrote: > Andrew Johnson wrote: >> On Tue, 21 Mar 2006 01:20:36 +0900, Claudio Jeker >> wrote: >> >> [snip] >>> Now I can IO.popen the process but there is no pclose instance method to >>> get the exitcode back. Additionally my workaround via >>> Process.waitpid2 does >>> not work either. I think io.close does already all the cleanup. >> >> The $? variable will hold the exit status of the last child to terminate. >> >> andrew >> > $? does not work with popen, or open3. I am not sure why one would want > to run a process, and monitor the output, yet not care what the exit > status is? One would think that this oversite will be fixed in future > releases. > > ~S ps - you can call Process.wait to update $?, but it is not reliable if your program is multi threaded.