From: Robert Klemme Date: 2008-07-01T20:53:33+09:00 Subject: Re: in select: interrupt 2008/7/1 Mark Firestone : > Anyone getting errors like this.... I'm working on a console mode full > screen editor (that Dossy kindly prototyped for me years ago). > Basically, it's reading $STD_IN with a select, thusly: > > > if select([@in_io], nil, nil, 1) > c = @in_io.sysread(1) > > > {lots of stuff to process the input follows...} > > Funny thing is, there seems to be a finite amount of code that can be > below here, in the input loop. After I add a certian amount, I start > getting funny errors while I'm typing in the editor, either in select: > interrupt, or the program simply says "Quit" and abends. > > If I take some code out, the behaviour stops. Problem is, I need this > code. I was also having the same issues when i was using > term/ansicolor. I wrote my own ansi module and this went away, until > I started adding code to the select loop. > ... > I've used select in this way before, on a TCP/IP socket, with no issues.... Frankly, this is far too little information to come up with any meaningful reply. You do not even give specific errors or stack traces. From what you posted I'd say it is something timing related or mixing sysread with other IO operations but these are a totally wild guesses. Personally I start implementing with #read and only switch to #sysread if there is a particular reason for using this. Cheers robert -- use.inject do |as, often| as.you_can - without end