Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > How do I prevent ruby on windows from automatically converting filename arguments?

Reply
Thread Tools

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

 
 
robertlaferla@comcast.net
Guest
Posts: n/a
 
      04-30-2007
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?


 
Reply With Quote
 
 
 
 
William James
Guest
Posts: n/a
 
      04-30-2007
On Apr 30, 1:02 pm, (E-Mail Removed) 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?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
The filename set in the response.setHeader("Content-Disposition", "attachment; filename=test.csv") is being ignored! Ed Java 10 07-13-2010 12:43 PM
Stitch rar files ( filename.part01 and filename.part02) Please help ixgor Software 1 10-15-2006 02:33 AM
how to get 8.3 format filename from long filename jacobyv@sis.unibe.ch Java 1 06-15-2006 10:39 AM
Extract filename from a filename typed by user =?Utf-8?B?Sm9l?= ASP .Net 1 08-23-2004 11:29 PM



Advertisments