From: Yuri Klubakov Date: 2007-07-19T01:13:57+09:00 Subject: Re: Change in Dir.glob behavior on Windows between 1.8.5 and 1.8.6 On 7/18/07, Ronald Fischer wrote: > > I've checked ruby-talk emails regarding Dir.glob and File.join but > > didn't see this one reported before. > > > > C:\> ruby --version > > ruby 1.8.5 (2006-12-25 patchlevel 12) [i386-mswin32] > > > > C:\> irb > > irb(main):001:0> Dir.glob(File.join(ENV['USERPROFILE'], '*.rnd')) > > => [C:\\Documents and Settings\\yura/putty.rnd"] > > > > C:\> ruby --version > > ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] > > > > C:\> irb > > irb(main):001:0> Dir.glob(File.join(ENV['USERPROFILE'], '*.rnd')) > > => [] > > I could reproduce this on my system too. > > Could it be that 1.8.6 Dir.glob gets upset on the spaces in > ENV['USERPROFILE']? No, it's File:ALT_SEPARATOR (\): C:\> ruby --version ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] C:\> irb irb(main):001:0> Dir.glob(File.join(ENV['USERPROFILE'], '*.rnd').gsub(File::ALT_SEPARATOR, File::SEPARATOR)) => [C:/Documents and Settings/yura/putty.rnd"] irb(main):002:0> Dir.glob(File.join(ENV['USERPROFILE'], '*.rnd').gsub(File::SEPARATOR, File::ALT_SEPARATOR)) => [] -- yura.