From: "Hal E. Fulton" Date: 2003-05-15T04:06:43+09:00 Subject: Re: 'gets' flagged as 'Bad file descriptor' - why? ----- Original Message ----- From: "RLMuller" To: "ruby-talk ML" Sent: Wednesday, May 14, 2003 1:56 PM Subject: Re: 'gets' flagged as 'Bad file descriptor' - why? > Great book! Thanks... > I've been running from an SciTE environment, where I've run many other Ruby > test pgms. Since you raised the question, I tested from a Command Window > ... successfully! Thanks. > > Of course, now I have a Ruby/SciTE question. If you have any suggestion as > whom to contact about that, > I'd appreciate additional advice. Perhaps I'll re-post this question under > a new subject. Well, I guess what's happening is that when you do a gets() in that way, without a window, it doesn't know where/how to get the input. Maybe a simple GUI would help that. It should only take a few lines in the GUI of your choice to throw up a dialog box... of course, to get a little fancier, you could use some specialized widget that browses for filenames in a tree. If you do something like that, why don't you share it with the list? Cheers, Hal > Regards, > Richard > > ----- Original Message ----- > From: "Hal E. Fulton" > To: "ruby-talk ML" > Sent: Wednesday, May 14, 2003 2:15 PM > Subject: Re: 'gets' flagged as 'Bad file descriptor' - why? > > > > ----- Original Message ----- > > From: "RLMuller" > > To: "ruby-talk ML" > > Sent: Wednesday, May 14, 2003 12:20 PM > > Subject: 'gets' flagged as 'Bad file descriptor' - why? > > > > > > > Hi All. > > > > > > I'm a newbie to Ruby. When I tried running the following code excerpted > > > from The Ruby Way, p. 405, on a Win2000SP3 system using ruby 1.6.8 > > > (2002-12-24) [i586-mswin32]: > > > > > > require "win32ole" > > > print "Enter the filename to print: " > > > docfile = gets > > > ... > > > > > > returns an error for line 3: > > > > > > `gets': Bad file descriptor (Errno::EBADF) > > > > > > Thanks for any info you may be able to offer. > > > > Hmm. Not sure on this one. > > > > My first question is: Are you running this > > by double-clicking on an icon, or from the > > command line? > > > > > > Hal > > > > > >