dan.macdaddy+ruby
2/1/2008 4:07:00 AM
[Note: parts of this message were removed to make it a legal post.]
If i recall correctly, ruby will convert paths between different os's if it
can.
So instead of
system('dir e:\\"program files"')
you could use
system('dir "e:/program files"')
and save yourself escaping the backslash.
On Feb 1, 2008 2:24 PM, Michael W. Ryder <_mwryder@worldnet.att.net> wrote:
> Junkone wrote:
> > Hello. this system command works from the command prompt but not from
> > irb. when i have a space in the directory name, the irb system command
> > cannot take it.
> >
> > irb(main):008:0> system("dir e:\\program files")
> > Volume in drive E has no label.
> > Volume Serial Number is N857-EB60
> >
> > Directory of e:> >
> > File Not Found
> >
> > Directory of E:\Documents and Settings\rocky
> >
> > File Not Found
> > => false
> >
> >
> > When i try this thro command prompt, it works
> > E:\Documents and Settings\rocky>dir "e:\program files"
> > Volume in drive E has no label.
> > Volume Serial Number is B857-EB62
> >
> > Directory of e:\program files
> >
> > 26/01/2008 06:41 PM <DIR> .
> > 26/01/2008 06:41 PM <DIR> .. ..
>
>
> Have you tried system('dir e:\\"program files"') ?
> This works for me in irb.
>
>