From: GOTO Kentaro Date: 2002-09-24T01:02:51+09:00 Subject: Re: File.lib bug? At Mon, 23 Sep 2002 21:56:26 +0900, Overnight wrote: > Using 1.6.7 on a win98 box: > > C:\>irb > irb(main):001:0> d=File.join('c:/','windows') > "c://windows" > irb(main):002:0> File.directory?(d) > false > irb(main):003:0> File.directory?('c:/windows') > true > irb(main):004:0> File.expand_path(d) > "c:/windows" > irb(main):005:0> File.directory?(File.expand_path(d)) > true > > Has this been fixed in 1.7.x? I've found the expand_path() trick in ruby- > talk, but couldn't find any other reference to this problem. I'm guessing that the reason why File.directory?(d) == false was File.exist?(d) == false. File.join is intended to absorb the deference of path separator among platforms. File.join(a,b,c,d) is equivalent to [a,b,c,d].join(File::SEPARATOR) So, File.join('c:/', 'windows') should be File.join('c:', 'windows'). > BTW: is there some documentation about 1.7.x? I've searched for it, but > wasn't able to find anything... I'm afraid documentation about 1.7 is written in only Japanese. That is being written on an Wiki system. -- Gotoken