How to tell Ruby the relative path of file

Discussion in 'Ruby' started by Li Chen, Jan 8, 2008.

  1. Li Chen

    Li Chen Guest

    Hi all,

    I use window vista version. I want to open a file using relative path.I
    wonder it is possible and how.

    Thank you very much,

    Li
    --
    Posted via http://www.ruby-forum.com/.
     
    Li Chen, Jan 8, 2008
    #1
    1. Advertising

  2. Li Chen

    Roger Pack Guest

    > I use window vista version. I want to open a file using relative path.I
    > wonder it is possible and how.


    Check out the "require_all" gem which has a require_rel method.

    or "require_relative" from backports/1.9:
    http://github.com/marcandre/backports/tree/master

    Also note that if you want to calculate a relative path between two
    files, use Pathname#relative_path_from

    GL.
    -r
    --
    Posted via http://www.ruby-forum.com/.
     
    Roger Pack, Sep 3, 2009
    #2
    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,719
    Sudsy
    Jul 8, 2004
  2. Thomas Guettler
    Replies:
    3
    Views:
    790
    Andrei
    Oct 27, 2003
  3. Oren
    Replies:
    1
    Views:
    570
    Michael D. Ober
    Apr 29, 2007
  4. Nigel Wilkinson
    Replies:
    2
    Views:
    420
    Nigel Wilkinson
    Jul 25, 2005
  5. Shekar Ls
    Replies:
    3
    Views:
    169
    Brian Candler
    Aug 19, 2009
Loading...

Share This Page