From: Brian Candler Date: 2003-02-27T19:50:39+09:00 Subject: Re: Threads, pipes, popen, whatever On Thu, Feb 27, 2003 at 06:57:18PM +0900, Michael Shigorin wrote: > On Tue, Feb 25, 2003 at 05:52:08PM +0900, Robert Klemme wrote: > > Normally you would use IO.popen but I can't see a way to access > > the exit status of the process directly. > > $? won't work? It does appear to work as advertised: f = IO.popen("/usr/bin/false","w") f.write "ignoreme" f.close puts $? #>> 256 It would be nice if the status hung around as an instance variable of f though. It would also be nice if you didn't have to split it into WEXITSTATUS and WTERMSIG by hand: e.g. puts $?.exited? # WIFEXITED puts $?.exitstatus # WEXITSTATUS puts $?.termsig # WTERMSIG etc But it looks like $? is actually just a Fixnum, in 1.6.8 anyway. Regards, Brian.