Uri to absolute/relative path

Discussion in 'Ruby' started by App Ra, Oct 19, 2006.

  1. App Ra

    App Ra Guest

    Hello, I'm new to ruby but so far my experience with Ruby has been
    great. I'm unable to open an uri based on the file path.

    This works
    require 'open-uri'
    open("http://www.ruby-lang.org/") {|f|
    f.each_line {|line| p line}
    }


    but this doesn't

    require 'open-uri'
    open("file:c://test/test.txt") {|f|
    f.each_line {|line| p line}
    }

    Can Ruby uri class open up a file schema?

    Thanks,
    apparna


    --
    Posted via http://www.ruby-forum.com/.
    App Ra, Oct 19, 2006
    #1
    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. Matt
    Replies:
    3
    Views:
    19,537
    Sudsy
    Jul 8, 2004
  2. Pavel
    Replies:
    2
    Views:
    1,634
    Peter Flynn
    Aug 4, 2004
  3. etheriau
    Replies:
    1
    Views:
    665
    Pavel
    Aug 23, 2004
  4. Thomas Guettler
    Replies:
    3
    Views:
    753
    Andrei
    Oct 27, 2003
  5. Turbo
    Replies:
    2
    Views:
    154
    Turbo
    Nov 1, 2006
Loading...

Share This Page