S
S. Robert James
Sometimes when using Ruby's FTP lib, I get this weird error:
#<EOFError: end of file reached>
I get this both on Linux and Windows. Googling around shows that other
people have reported it, although no one seems to know what causes it
or how to solve it (other than trying to reboot).
http://jonaquino.blogspot.com/2005/03/ruby-ftp-error.html
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/101791
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/86343
Looking at the source, my only guess is that it's caused if the client
tries to read before the remote host has sent the data. (But I don't
know enough about Ruby socket programming for this to be more than a
guess.)
# net/ftp.rb:210
def getline
line = @sock.readline # if get EOF, raise EOFError
line.sub!(/(\r\n|\n|\r)\z/n, "")
Anyone capable of solving this bug, or at least have a workaround?
(Here is a stack trace:
#<EOFError: end of file reached>
"/ruby/lib/ruby/1.8/net/ftp.rb:211:in `readline'"
"/ruby/lib/ruby/1.8/net/ftp.rb:211:in `getline'"
"/ruby/lib/ruby/1.8/net/ftp.rb:221:in `getmultiline'"
"/ruby/lib/ruby/1.8/net/ftp.rb:235:in `getresp'"
"/ruby/lib/ruby/1.8/net/ftp.rb:251:in `voidresp'"
"/ruby/lib/ruby/1.8/net/ftp.rb:176:in `connect'"
"/ruby/lib/ruby/1.8/monitor.rb:229:in `synchronize'"
"/ruby/lib/ruby/1.8/net/ftp.rb:174:in `connect'"
"/ruby/lib/ruby/1.8/net/ftp.rb:136:in `initialize'"
"/ruby/lib/ruby/1.8/net/ftp.rb:120:in `open'"
"my_code/connection.rb:27:in `ftp'" # Net::FTP.open(ftp_host,
username, password)
#<EOFError: end of file reached>
I get this both on Linux and Windows. Googling around shows that other
people have reported it, although no one seems to know what causes it
or how to solve it (other than trying to reboot).
http://jonaquino.blogspot.com/2005/03/ruby-ftp-error.html
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/101791
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/86343
Looking at the source, my only guess is that it's caused if the client
tries to read before the remote host has sent the data. (But I don't
know enough about Ruby socket programming for this to be more than a
guess.)
# net/ftp.rb:210
def getline
line = @sock.readline # if get EOF, raise EOFError
line.sub!(/(\r\n|\n|\r)\z/n, "")
Anyone capable of solving this bug, or at least have a workaround?
(Here is a stack trace:
#<EOFError: end of file reached>
"/ruby/lib/ruby/1.8/net/ftp.rb:211:in `readline'"
"/ruby/lib/ruby/1.8/net/ftp.rb:211:in `getline'"
"/ruby/lib/ruby/1.8/net/ftp.rb:221:in `getmultiline'"
"/ruby/lib/ruby/1.8/net/ftp.rb:235:in `getresp'"
"/ruby/lib/ruby/1.8/net/ftp.rb:251:in `voidresp'"
"/ruby/lib/ruby/1.8/net/ftp.rb:176:in `connect'"
"/ruby/lib/ruby/1.8/monitor.rb:229:in `synchronize'"
"/ruby/lib/ruby/1.8/net/ftp.rb:174:in `connect'"
"/ruby/lib/ruby/1.8/net/ftp.rb:136:in `initialize'"
"/ruby/lib/ruby/1.8/net/ftp.rb:120:in `open'"
"my_code/connection.rb:27:in `ftp'" # Net::FTP.open(ftp_host,
username, password)