sysread error

Discussion in 'Ruby' started by Alfonso Caponi, Jul 17, 2008.

  1. 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/.
     
    Alfonso Caponi, Jul 17, 2008
    #1
    1. Advertising

  2. 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!
     
    David A. Black, Jul 17, 2008
    #2
    1. Advertising

  3. 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/.
     
    Alfonso Caponi, Jul 17, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hal Fulton

    sysread and buffered I/O

    Hal Fulton, Jul 21, 2004, in forum: Ruby
    Replies:
    39
    Views:
    702
    Tanaka Akira
    Jul 24, 2004
  2. William E. Rubin
    Replies:
    3
    Views:
    133
    William E. Rubin
    Dec 8, 2005
  3. Muazzam Mushtaq
    Replies:
    0
    Views:
    389
    Muazzam Mushtaq
    Mar 28, 2006
  4. Venkat Bagam

    multithreading sysread error

    Venkat Bagam, Mar 5, 2008, in forum: Ruby
    Replies:
    3
    Views:
    94
    Venkat Bagam
    Mar 10, 2008
  5. Daniel Berger
    Replies:
    4
    Views:
    227
    Daniel Berger
    Sep 12, 2008
Loading...

Share This Page