[Win32utils-devel] Fwd: Is select() untrustworthy on Windows when used with handles from popen3?
djberg96 at gmail.com
Fri Mar 21 13:30:13 EDT 2008
---------- Forwarded message ----------
From: Steve Shreeve <steve.shreeve at gmail.com>
Date: Thu, Mar 13, 2008 at 10:51 AM
Subject: Is select() untrustworthy on Windows when used with handles
To: djberg96 at gmail.com
Thanks for your work on the win32util modules.
I've created an expect-like library that allows one to easily script
interactions with non-GUI applications. Everything works great when
connecting to the target system using a socket, or using PTY.spawn on
Linux. On Windows, I get quite a bit of grief. Here's an example that
has me confused:
irb(main):001:0> require 'win32/open3'
irb(main):002:0> i,o,e = Open3.popen3('date')
=> [#<IO:0x2b42a4c>, #<IO:0x2b42a24>, #<IO:0x2b42a10>, 3164]
=> "The current date is: Thu 03/13/2008 \nEnter the new date: (mm-dd-yy) "
=> [[#<IO:0x2b42a24>], , ]
# => here, it hangs... even though it *says* there's input to read ]==
Since we hang at this spot, I'm sorta hosed... how can I trust select()?
ps - I'd be happy to pay for your time to assist with this.
More information about the win32utils-devel