From: nedry Date: 2003-05-16T09:55:55+09:00 Subject: another popen question...the ruby bbs All this talk of popen put me in mind of something. I could use it to link the Ruby BBS to external programs, specifically all those old dos door games by using dosemu and redirecting the output... I got it to get the data from the application ok, but I can't figure out how to get data to the application.... nothing seems to be happening when I write data to the external process... any ideas, advice, boots to the head would be appreciated (keeping in mind that it is now 2am...) def doortest begin pipe = IO.popen("./dosemu,"w+") while true puts ("loop...") if select([pipe],nil,nil,0.1) !=nil char = pipe.getc puts "char: #{char}" #if char != nil @socket.write (char.chr) @socket.write CR.chr if char == LF else if select([@socket],nil,nil,0.1) != nil puts "socket hit" char = @socket.getc puts char.chr pipe.putc(char.chr) if char != nil end end end rescue print ("\r\nDisconnected from Application...\r\n") pipe.close end end Thanks! Mark Firestone