From: James Tucker Date: 2008-01-07T03:16:29+09:00 Subject: Problems with Windows Console IO was Re: problem with sockets On 5 Jan 2008, at 21:45, ian@frogcottage.demon.co.uk wrote: > > Hi, thanks for the reply. I read it very slowly. Thank you. > The problem is the way that ruby deals with the ConsoleIO, which is in > effect a problem with ruby, from my point of view. I don't disagree. The problem was, you were still talking about sockets. ;-) > So, how can I "generate" data from a user, do they have to put it in a > file first? Well if you really need data from the user then you'll need to find out how to do a non-blocking read from STDIN on Windows. This may or may not work in the popular Highline lib. I haven't yet found a need to resolve this long term problem myself, and as such I don't know how to yet. It's possible that Daniel Berger might know more, or that one of his Win32 projects can help you. > Or do I have to call a .cmd script from inside ruby? > It seems to me, like I'm having to jump through hoops just to do a > basically simple thing, which is fair enough, but they don't tell you > that do they. Again, I don't disagree. > Anyway thanks for the advice, I was intrigued as to why I couldn't get > it to work. > I'll give it a go in Python, and see if that works "out of the box", > just out of curiosity. It may well. It's important to note that the only problem is with STDIN when it's reading from the Console, it seems to work just fine reading from file (although I haven't done parallel file access under win32 that requires significant threading), and it works just fine with sockets. It's a shame to loose a user to this, but it doesn't surprise me.