From: Daniel Berger Date: 2005-08-26T10:44:09+09:00 Subject: Re: [ ruby-Bugs-2308 ] Problem with mkmf and spaces in directory names? --- noreply@rubyforge.org wrote: > Bugs item #2308, was opened at 2005-08-25 13:42 > You can respond by visiting: > http://rubyforge.org/tracker/?func=detail&atid=1698&aid=2308&group_id=426 > > Category: None > Group: None > Status: Open > Resolution: None > Priority: 3 > Submitted By: Tim Smith (tsmith) > Assigned to: Nobody (None) > Summary: Problem with mkmf and spaces in directory > names? > > Initial Comment: > See: > http://www.ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-talk/104505 > > The problem remains as of ruby 1.8.2 (2004-12-25) > [i386-mswin32]. With c:/program files/ruby, mkmf > does not quote or shorten (progra~1) the path, > causing, for example: > > Error makefile 99: Redefinition of target > 'c:/program' > > Can this be fixed? I brought this up back in ruby-talk:104505. It appears to be a bug in cl.exe. It would be easy enough to patch this by wrapping all paths on Windows with GetShortPathName(). This could be done with the Win32API package: require "Win32API" GetShortPathName = Win32API.new("kernel32","GetShortPathName","PPL","L") path = "C:\\program files\\mozilla firefox" buff = 0.chr * 260 GetShortPathName.call(path, buf, buf.length) short_path = buf.split(0.chr).first p short_path # "C:\\PROGRA~1\\MOZILL~1" The only potential gotcha, iirc, is that short paths can be disabled as a filesystem speedup tweak, so it wouldn't help people who had done that. I think it's better than nothing, however. Regards, Dan __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com