noreply at rubyforge.org
2006-Apr-16 17:07 UTC
[Win32utils-devel] [ win32utils-Patches-4121 ] Make it possible to read process exit status
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
noreply at rubyforge.org
2006-Apr-17 22:57 UTC
[Win32utils-devel] [ win32utils-Patches-4121 ] Make it possible to read process exit status
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. ---------------------------------------------------------------------->Comment By: Samuel Tesla (stesla)Date: 2006-04-17 17:57 Message: One thing to note. My C-foo on windows isn''t the greatest. There /is/ a global variable in process.c called rb_last_status which is what is hooked up to $?. In io.c and eval.c that variable is used as an extern. I don''t know if you can get to that from a DLL. I tried just doing "extern VALUE rb_last_status" but always got a blow-up when I assigned to it. If there''s some way to declare it so that we can get to it from inside the module, that would probably be better than #last_status. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=4121&group_id=85
noreply at rubyforge.org
2006-Apr-23 17:48 UTC
[Win32utils-devel] [ win32utils-Patches-4121 ] Make it possible to read process exit status
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. ---------------------------------------------------------------------- Comment By: Samuel Tesla (stesla) Date: 2006-04-17 17:57 Message: One thing to note. My C-foo on windows isn''t the greatest. There /is/ a global variable in process.c called rb_last_status which is what is hooked up to $?. In io.c and eval.c that variable is used as an extern. I don''t know if you can get to that from a DLL. I tried just doing "extern VALUE rb_last_status" but always got a blow-up when I assigned to it. If there''s some way to declare it so that we can get to it from inside the module, that would probably be better than #last_status. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=4121&group_id=85
noreply at rubyforge.org
2006-Apr-23 17:50 UTC
[Win32utils-devel] [ win32utils-Patches-4121 ] Make it possible to read process exit status
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. ---------------------------------------------------------------------->Comment By: Samuel Tesla (stesla)Date: 2006-04-23 12:50 Message: I figured out how to get to the global that $? reads from, so this new patch makes win32-open3 pretty much behave exactly like the unix open3. ---------------------------------------------------------------------- Comment By: Samuel Tesla (stesla) Date: 2006-04-17 17:57 Message: One thing to note. My C-foo on windows isn''t the greatest. There /is/ a global variable in process.c called rb_last_status which is what is hooked up to $?. In io.c and eval.c that variable is used as an extern. I don''t know if you can get to that from a DLL. I tried just doing "extern VALUE rb_last_status" but always got a blow-up when I assigned to it. If there''s some way to declare it so that we can get to it from inside the module, that would probably be better than #last_status. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=4121&group_id=85
Possibly Parallel Threads
- [ win32utils-Patches-4121 ] Make it possible to read process exit status
- [ win32utils-Patches-4603 ] [open3] set $? and return Process::Status with block call
- Open3.popen3 oddity
- [ win32utils-Feature Requests-3502 ] Allow win32-open3 to take a block
- win32-process 0.3.1 is out