Caleb Clausen wrote:
> My recollection is that on windows, select only works on sockets. It
> doesn't do anything useful with pipes. You are far from being the
> first programmer to regret that this is the case.

To make sure that I've been using it right, select is supposed to check 
if the IO objects have data ready, and if so, return an array of the 
ready objects?

require("socket")

server = TCPServer.new("localhost",0)
insock = TCPSocket.new(server.addr[3],server.addr[1])
outsock = server.accept()
server.close()

puts("Select starting...")
ready = select([outsock])
puts("Select is over.")

I created a quick test program to make sure that select was working how 
I thought it did. When this program is run, it outputs "Select 
starting...", and then locks up, because it's waiting for outsock to 
receive data (which it never will). What I hoped it would do is output 
"Select starting..." and then output "Select is over.", because no data 
was ready to be read from outsock.

If I'm using it correctly, is there an alternative to this on Windows 
machines?
-- 
Posted via http://www.ruby-forum.com/.