From: Wilson Bilkovich Date: 2007-09-27T10:16:22+09:00 Subject: Re: trouble with pathname (i.e slashes) & windows On 9/26/07, dtown22@gmail.com wrote: > Hi, > > I am a bit of a ruby newbie, and i cant figure out this problem. I am > recursively searching through some directories, and when i find the > one i want, i try to pass it to an external process, through 'system' > but the forward slashes screw things up. Your best bet is probably to follow these rules: 1. Inside Ruby (meaning, anywhere but between two backtick characters or in the 'system' method), always use forward-slashes. 2. When calling out to the system, do this: class String def nightmareify self.gsub(/\//, '\\\\') end end irb> puts "c:/foo/baz".nightmareify c:\foo\baz Feel free to choose a different method name, depending on your level of irritation at this: http://blogs.msdn.com/larryosterman/archive/2005/06/24/432386.aspx