On Sun, Nov 2, 2008 at 9:45 PM, James M. Lawrence
<[EMAIL PROTECTED]> wrote:
>
> system("cmd.exe", "/c", "test.bat", *args) # works
> system("cmd.exe", "/c", "c:\\path\\to\\test.bat", *args) # works
> system("cmd.exe", "/c", "c:\\path\\to\\foo foo\\test.bat", *args) # fails
> system("cmd.exe", "/c", "\"c:\\path\\to\\foo foo\\test.bat\"", *args) #
> fails
>
> For jruby.bat and multi-argument sh() we could use the first form
> above, though bindir is still a problem. I don't know of another
> solution.
...other than single-argument system() with a quoted full path, as in
the current RUBY constant.
So it's a toss-up between --
(1) Single-argument system() for all cases of sh(), including
multi-argument sh(). Why it's bad: the user can accidentally depend
on the shell, causing breakage on non-Windows machines. Example:
sh("cat", "foo", ">", "out").
(2) Multi-argument system() via cmd.exe /c for multi-argument sh().
Why it's bad: assumes jruby is in PATH and is the same jruby currently
running.
_______________________________________________
Rake-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rake-devel