From noreply at rubyforge.org Sun Jul 2 22:48:18 2006 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 2 Jul 2006 22:48:18 -0400 (EDT) Subject: [Win32utils-devel] [ win32utils-Patches-4121 ] Make it possible to read process exit status Message-ID: <20060703024819.29A885240F08@rubyforge.org> Patches item #4121, was opened at 2006-04-16 10: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: Closed >Resolution: Accepted 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: Daniel Berger (djberg96) Date: 2006-07-02 19:48 Message: Incorporated into 0.2.3. :) - Dan ---------------------------------------------------------------------- Comment By: Samuel Tesla (stesla) Date: 2006-04-23 10: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 15: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 From noreply at rubyforge.org Sun Jul 2 22:48:46 2006 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 2 Jul 2006 22:48:46 -0400 (EDT) Subject: [Win32utils-devel] [ win32utils-Patches-4603 ] [open3] set $? and return Process::Status with block call Message-ID: <20060703024846.EEF9C5240F08@rubyforge.org> Patches item #4603, was opened at 2006-05-29 14:07 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=4603&group_id=85 Category: win32-open3 Group: Bug Fix >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: John-Mason Shackelford (jpshackelford) Assigned to: Nobody (None) Summary: [open3] set $? and return Process::Status with block call Initial Comment: This is another version Samuel Tesla's patch which sets $? and also returns the Process::Status when popen3/4 is called with a block (i.e. this patch merges changes from the two patches Samuel submitted). Note that this implementation is not thread-safe. As the attachment will demonstrate. ---------------------------------------------------------------------- >Comment By: Daniel Berger (djberg96) Date: 2006-07-02 19:48 Message: Now in 0.2.3. Many thanks. - Dan ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2006-06-18 07:37 Message: Hi again, After reading your post again I realized that $? is only set when the block form is used. Is there any way to set $? when the non-block form is used? What does the Unix variant do? If that doesn't make sense, or is just too difficult, then I won't worry about it. I thought I would ask, though. Dan ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2006-06-01 20:13 Message: The patch looks good to me. I'm not particularly worried about thread safety issues when it comes to running external programs, so I'm not going to worry about it. I'll have Heesob take a look. Thanks, Dan ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=4603&group_id=85 From djberg96 at gmail.com Mon Jul 3 10:57:27 2006 From: djberg96 at gmail.com (Daniel Berger) Date: Mon, 03 Jul 2006 08:57:27 -0600 Subject: [Win32utils-devel] Some cvs surgery Message-ID: <44A93057.1020709@gmail.com> Hi all, I've had Tom move a bunch of the projects under win32utils/ (the subdirectory in CVS) moved up to the top level directory. From now on there should be NO commits in any of the folders still under the win32utils/ subdirectory. I'm eventually going to have those removed. Regards, Dan From djberg96 at gmail.com Tue Jul 4 13:40:02 2006 From: djberg96 at gmail.com (Daniel Berger) Date: Tue, 04 Jul 2006 11:40:02 -0600 Subject: [Win32utils-devel] Reworking win32-mmap for the pure Ruby version Message-ID: <44AAA7F2.60805@gmail.com> Hi all, I was looking at win32-mmap today. I thought it might be worth it to rewrite this one as pure Ruby. In the process, I decided I don't really like the current API very much. Just feels too clunky and not very friendly. I think we followed Win32::MMF too closely. Anyway, I have a very preliminary version in CVS that I was hoping folks could take a look at and comment on. Just a few comments on why I changed some things: * I thought that OpenFileMapping should have its own method, i.e. MMap.open if you want to open an existing mapping, MMap.new if you want to create a new mapping. This felt conceptually cleaner than a "reuse" option, and helped reduce code clutter in the initialize method. * I ditched the hash style interface in favor of a block style "yield self". I just don't feel like handling (validating, etc) hash keys any more. * I wanted the ability to explicitly close and flush a file mapping, so I added MMap#close and MMap#flush. Please note that this is a very alpha first attempt. Note the lack of a Semaphore for the mapping, for example. I want to think about that some more. Any and all comments are welcome. Note that you'll need the latest windows-pr from CVS to make this work as-is. Regards, Dan PS - Happy 4th of July!