On 5/12/07, Austin Ziegler <halostatue / gmail.com> wrote:
> 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/"

Not according to Microsoft's Scripting.FileSystemObject:

  Fs.GetBaseName("C:/") = ""
  Fs.GetParentFolderName("C:/") = ""
  Fs.GetBaseName("//server/share/") = ""
  Fs.GetParentFolderName("//server/share/") = ""

  nikolai