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

R

robertlaferla

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?
 
W

William James

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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top