From: Dan Date: 2008-02-01T13:06:56+09:00 Subject: Re: system command is wierd ------=_Part_29955_13514299.1201838822984 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 . > > 26/01/2008 06:41 PM .. .. > > > Have you tried system('dir e:\\"program files"') ? > This works for me in irb. > > ------=_Part_29955_13514299.1201838822984--