Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > sysread error

Reply
Thread Tools

sysread error

 
 
Alfonso Caponi
Guest
Posts: n/a
 
      07-17-2008
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
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
David A. Black
Guest
Posts: n/a
 
      07-17-2008
Hi --

On Thu, 17 Jul 2008, Alfonso Caponi wrote:

> 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


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

--
Rails training from David A. Black and Ruby Power and Light:
Intro to Ruby on Rails July 21-24 Edison, NJ
Advancing With Rails August 18-21 Edison, NJ
See http://www.rubypal.com for details and updates!

 
Reply With Quote
 
 
 
 
Alfonso Caponi
Guest
Posts: n/a
 
      07-17-2008
David A. Black wrote:
> Hi --
>
> On Thu, 17 Jul 2008, Alfonso Caponi 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'


--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Errno::EOVERFLOW error with IO#read and IO#sysread Daniel Berger Ruby 4 09-12-2008 06:44 PM
multithreading sysread error Venkat Bagam Ruby 3 03-10-2008 06:21 AM
Timeout Error or sysread': end of file reached (EOFError) Muazzam Mushtaq Ruby 0 03-28-2006 05:05 AM
invalid arg to sysread deep within protocol.rb William E. Rubin Ruby 3 12-08-2005 09:53 PM
sysread and buffered I/O Hal Fulton Ruby 39 07-24-2004 03:45 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57