Robert Klemme
4/12/2009 3:54:00 PM
On 12.04.2009 04:58, Roger Pack wrote:
>> Errno::EBADF: Bad file descriptor
>> from C:/Ruby/lib/ruby/1.8/net/http.rb:564:in `write'
>> from C:/Ruby/lib/ruby/1.8/net/http.rb:564:in `warn'
>> from C:/Ruby/lib/ruby/1.8/net/http.rb:564:in `connect'
>> from C:/Ruby/lib/ruby/1.8/net/http.rb:553:in `do_start'
>> from C:/Ruby/lib/ruby/1.8/net/http.rb:542:in `start'
>> from C:/Ruby/lib/ruby/1.8/net/http.rb:1035:in `request'
>> from C:/Ruby/lib/ruby/1.8/net/http.rb:845:in `post'
>> from (irb):15:in `authentication'
>> from (irb):23
>> from :0
>> irb(main):024:0>
>
> It may mean that google has summarily hung up on you.
I believe you would see a different error. EBADF occurs, if the file
descriptor (i.e. the numeric value) is invalid. You can provoke it by
doing something like this
ruby -e 'File.open(10, "w") {|f| f.puts "test"}'
Whereas it does not happen if you do
ruby -e 'File.open(1, "w") {|f| f.puts "test"}'
One way to create this is to open a file, remember the number returned
from #fileno, close the file and then open another file with the
remembered number (file descriptor).
Kind regards
robert