[Win32utils-devel] win32-process 0.3.1 is out

win32utils-devel at rubyforge.org win32utils-devel at rubyforge.org
Fri Dec 10 15:12:43 EST 2004

Thanks Dan, much appreciated.

I have some other patches coming up soon :-) Here is what I'd like to
do (expressed as a unit test since I am a TDD zealot). This relies on
the soon-to-be popen4.

require 'test/unit'
require 'timeout'
require "win32/open3"
require 'win32/process'

class Process2Test < Test::Unit::TestCase  
  def test_can_timeout_native_function
    timeout(2) do
      pid = nil
        Open4.popen4("notepad") do |stdin, stdout, stderr, pid|
        fail("Should have timed out")
      rescue Timeout::Error => expected
        Process.kill(-9, pid) if pid        

The problem is - the timeout never happens and the test program blocks
until notepad is closed manually.

Any idea how to implement this so that the timeout can happen? I am
assuming the problem is related to the blocking nature of
WaitForSingleObject, and that we can't interrupt it. Do we have to
introduce some threads and mutexes and and such from the win32 api to
deal with this?


On Fri, 10 Dec 2004 08:29:10 -0600, win32utils-devel at rubyforge.org
<win32utils-devel at rubyforge.org> wrote:
> Hi all,
> Just wanted to let you know that I released 0.3.1 last night.  This
> addresses Bug #712 and incorporates Patches #1087 and #1137 (thanks
> Aslak).
> I'll try to get an open4 implementation out this weekend, though I
> noticed that Aslak's patch is different than what Park originally had,
> so I'll have to decide which I prefer, or if they can be blended
> somehow.
> Regards,
> Dan
> _______________________________________________
> win32utils-devel mailing list
> win32utils-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/win32utils-devel

More information about the win32utils-devel mailing list