# Sysread error

**URL:** <https://www.ruby-forum.com/t/sysread-error/143326>\
**Category:** Ruby\
**Created:** [July 17, 2008, 12:16pm UTC](https://www.ruby-forum.com/t/sysread-error/143326 "2008-07-17T12:16:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![al\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f08c70/32.png) [@al\_S](https://www.ruby-forum.com/u/al_S)\
**Post date:** [July 17, 2008, 12:16pm UTC](https://www.ruby-forum.com/t/sysread-error/143326/1 "2008-07-17T12:16:02Z")

</div>

Hi List,

I wrote a simple script that import a file list of hosts and try to  
connect.  
Before the end of the file the script exits with this error:

/usr/lib/ruby/1.8/net/protocol.rb:133:in `sysread’: end of file reached  
(EOFError)

I using this code to import list:

file = File.new(list,“r”)  
begin  
while (line = file.gets)  
line.chomp!  
iplist.push line  
end  
rescue EOFError  
f.close  
end

Can you help me please?  
Thank you very much

Al

---

<div class="post-metadata">

**Author:** ![al\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f08c70/32.png) [@al\_S](https://www.ruby-forum.com/u/al_S)\
**Post date:** [July 17, 2008, 1:49pm UTC](https://www.ruby-forum.com/t/sysread-error/143326/2 "2008-07-17T13:49:46Z")

</div>

Hi –

On Thu, 17 Jul 2008, Alfonso C. wrote:

> Can you help me please?  
> Thank you very much

It looks like the error is in the part of the script where you’re  
connecting to hosts, since it’s in the net code.

David

---

<div class="post-metadata">

**Author:** ![al\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f08c70/32.png) [@al\_S](https://www.ruby-forum.com/u/al_S)\
**Post date:** [July 17, 2008, 3:50pm UTC](https://www.ruby-forum.com/t/sysread-error/143326/3 "2008-07-17T15:50:07Z")

</div>

David A. Black wrote:

> Hi –
> 
> On Thu, 17 Jul 2008, Alfonso C. wrote:
> 
> > Can you help me please?  
> > Thank you very much
> 
> It looks like the error is in the part of the script where you’re  
> connecting to hosts, since it’s in the net code.
> 
> David

This is the complete error:

/usr/lib/ruby/1.8/net/protocol.rb:133:in `sysread': end of file reached (EOFError) from /usr/lib/ruby/1.8/net/protocol.rb:133:in`rbuf\_fill’  
from /usr/lib/ruby/1.8/timeout.rb:56:in `timeout' from /usr/lib/ruby/1.8/timeout.rb:76:in`timeout’  
from /usr/lib/ruby/1.8/net/protocol.rb:132:in `rbuf_fill' from /usr/lib/ruby/1.8/net/protocol.rb:116:in`readuntil’  
from /usr/lib/ruby/1.8/net/protocol.rb:126:in `readline' from /usr/lib/ruby/1.8/net/http.rb:1988:in`read\_status\_line’  
from /usr/lib/ruby/1.8/net/http.rb:1977:in `read_new' ... 6 levels... from /usr/lib/ruby/1.8/timeout.rb:56:in`timeout’
