From: daz Date: 2003-06-10T05:21:19+09:00 Subject: Re: Using 'gets' with SciTe under Win2000 "Richard" wrote in message news:32c026de.0306081458.2d1b5975@posting.google.com... > Hi All, > > The following runs fine in a Command window: > > print "Enter text: " > while gets > chomp! > puts 'Got "' + $_ + '"' > print 'Enter more: ' > end > > But running it in the SciTe 1.41 environment with Ruby 1.6.8, I get: > > Enter text: IO_Test1.rb:2:in `gets': Bad file descriptor > (Errno::EBADF) > > I've asked about this before on this NG, but wonder if anybody has an > idea about how to make this work under SciTe. It's my guess that > SciTe doesn't want to put a cursor in its output pane and accept > keystroke that it could pipe into the stdin stream. Is that the end > of the story? Is there a more appropriate NG to post this question? > > TIA, > Richard I get the same on 1.41 (Win98se) with your script. The STDIN Ruby sees is an IO object but with STDIN.fileno == -1 (should be 0). My guess is that this was fixed long ago in a later SciTE release. I know not why the 1.41 relic is distributed. There's a SciTE 1.52 'one-click' installer for Windows. (Includes a shell extension which adds 'Edit with SciTE' to the right-click context menu for all files.) http://gisdeveloper.tripod.com/scite.html Just over 1MB (4min d/l @ 56K) - fits on a floppy. Free of charge. (Thanks - Neil Hodgson, Andre Burgaud, Bruce Dodson et al. :))) It makes an excellent replacement for Notepad. In this version, your script runs as you would expect. daz