How do I prevent ruby on windows from automatically converting filename arguments?

Discussion in 'Ruby' started by robertlaferla@comcast.net, Apr 30, 2007.

  1. Guest

    I have a Windows batch file (mytest.bat) that calls a Ruby script (mytest).

    The mytest.bat looks like this:

    ruby %TOOLDIR%\bin\mytest %*

    When the batch file is called using "call mytest" from another Ruby script, it is automatically converting the command-line arguments. Specifically, it is converting path arguments:

    mytest -i "\testdir\mytests\test.dat"

    becomes

    "/testdir/mytests/test.dat"


    I do not want Ruby converting these paths. It seems like it is going through each string argument, detecting that it is a path and normalizing/converting each path from Windows-style to UNIX-style.

    How do I stop Ruby from doing this?
     
    , Apr 30, 2007
    #1
    1. Advertising

  2. On Apr 30, 1:02 pm, wrote:
    > I have a Windows batch file (mytest.bat) that calls a Ruby script (mytest).
    >
    > The mytest.bat looks like this:
    >
    > ruby %TOOLDIR%\bin\mytest %*
    >
    > When the batch file is called using "call mytest" from another Ruby script, it is automatically converting the command-line arguments. Specifically, it is converting path arguments:
    >
    > mytest -i "\testdir\mytests\test.dat"
    >
    > becomes
    >
    > "/testdir/mytests/test.dat"
    >
    > I do not want Ruby converting these paths.


    Why not? Are you aware that even under windoze, if a program
    written in Ruby or awk or Perl tries to open "/testdir/mytests/
    test.dat",
    it will do the right thing?

    By the way, how is your program converting these paths?
    Are you using File::expand_path?
     
    William James, Apr 30, 2007
    #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. =?Utf-8?B?Sm9l?=

    Extract filename from a filename typed by user

    =?Utf-8?B?Sm9l?=, Aug 23, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,065
    Travis Murray
    Aug 24, 2004
  2. Replies:
    1
    Views:
    1,596
    Roland de Ruiter
    Jun 15, 2006
  3. Ed
    Replies:
    10
    Views:
    46,691
    alok000707
    Jul 13, 2010
  4. Beauregard T. Shagnasty

    Re: filename.gif or filename.gif.jpg?

    Beauregard T. Shagnasty, May 30, 2008, in forum: HTML
    Replies:
    1
    Views:
    806
    Jonathan N. Little
    May 30, 2008
  5. Bergamot
    Replies:
    0
    Views:
    482
    Bergamot
    May 30, 2008
Loading...

Share This Page