From: MENON Jean-Francois Date: 2002-05-31T23:14:10+09:00 Subject: Re: "system" and Windows "Morris, Chris" wrote: > > I'm using pragprog 1.6.6-0 dist. system has some problems 'out of the box'. > Try the backticks instead, or substitute your system call a la > http://ruby-talk.com/10006 (which I have packaged up in a unit of mine > you'll see in the irb snippet below). > > irb(main):007:0> system('"c:/temp/dir name/test.bat"') > false > irb(main):008:0> `"c:/temp/dir name/test.bat"` > "\nS:\\SF-scrapware\\scrapware\\ruby\\cl\\index\\src>echo Test \nTest\n" > irb(main):009:0> require 'cl/util/win' > true > irb(main):010:0> system('"c:/temp/dir name/test.bat"') > > S:\SF-scrapware\scrapware\ruby\cl\index\src>echo Test > Test > 0 > irb(main):011:0> RUBY_VERSION > "1.6.6" > irb(main):012:0> RUBY_PLATFORM > "i586-mswin32" > irb(main):013:0> > > > I have a problem with the "system" command under Windows. > > when there is a space in the path of the binary, it doesn't > > worK I have > > try multiple arguments, double > > quoting but it doesn't work. > > for example: > > system ('"c:\Program Files\App\cmd.exe"',"file") > > doesn't work. > > what is the good way to do ? thx for your work but it would be better to have the original ruby command work isn't it ? -- _________________________________________ / do you play Go? \ |http://jeanfrancois.menon.free.fr/rubygo | \ / ----------------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || ||