[Win32utils-devel] [ win32utils-Patches-4121 ] Make it possible to read process exit status

noreply at rubyforge.org noreply at rubyforge.org
Sun Apr 16 13:07:18 EDT 2006


Patches item #4121, was opened at 2006-04-16 12:07
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=413&aid=4121&group_id=85

Category: win32-open3
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Samuel Tesla (stesla)
Assigned to: Nobody (None)
Summary: Make it possible to read process exit status

Initial Comment:
The UNIX Open3 sets the global $? to a Process::Status object so that one can read the exit status of the sub process.

It seems that one is not supposed to fiddle with /that/ variable, but we can make our own.  This patch adds a #last_status method to both the Open3 and Open4 modules that returns a Process::Status object that is set when the pipes are closed (similarly to how Ruby does it in io.c).

I also made popen3 and popen4 return the object when they're called with a block.  I figured it was as neat idea.

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=413&aid=4121&group_id=85


More information about the win32utils-devel mailing list