Nobuyoshi Nakada wrote:
> Hi,
> 
> At Sun, 13 May 2007 02:07:13 +0900,
> Austin Ziegler wrote in [ruby-core:11161]:
>> On 5/12/07, Nobuyoshi Nakada <nobu / ruby-lang.org> wrote:
>>> At Fri, 16 Feb 2007 02:09:08 +0900,
>>> Daniel Berger wrote in [ruby-core:10321]:
>>>> The File.basename method does not work properly on Windows
>>>> root paths. IMO, calling File.basename on a root path should
>>>> return itself. However, on MS Windows it appears to be
>>>> dropping the volume name and it doesn't handle UNC root paths
>>>> correctly:
>>> Drive letter is part of base name?  It feels very strange to me.
>> It's right, though.
>>
>> File.basename("C:/") should return "C:/"
>> File.dirname("C:/") should return "C:/"
>> File.basename("//server/share/") must return "//server/share/"
>> File.dirname("//server/share/") must return "//server/share/"
> 
> What's the reason?  Do you consider a drive letter to be a part
> of basename?
> 
> And if they were work so, then File.join(*File.split("C:/"))
> should return "C:/C:/", but it is incorrect on Windows.  Is it
> what you want?

File.split would have to be redefined as well, based on the new 
definitions of File.basename and File.dirname, making an explicit check 
for a root path via PathIsRoot(). This is what I do in win32-file.

Regards,

Dan