Hi,

At Sat, 30 Nov 2002 07:48:23 +0900,
Emmanuel Touzery wrote:
> I actually found File.split:
> irb(main):001:0> File.split("/home")
> ["/", "home"]
> irb(main):002:0> File.split("/")
> ["/", ""]
> 
> encouraging. if file.split(dir)[1] == "" it could mean it's root.

No, File#split just returns File#dirname and File#basename, and
File#basename returns "" when the path is ended with "/".

  File.basename("/home/") => ""

> however i don't know how it behaves under windows, but in linux:
> irb(main):003:0> File.split("c:\test")
> [".", "c:\test"]

Note that "\t" means a tab.

> irb(main):004:0> File.split("c:\\test")
> [".", "c:\\test"]

In 1.7, ["c:", "test"].  But these behaviors are curious.

  File.dirname("c:")	=> "."
  File.dirname("c:/")	=> "c:"
  File.dirname("c:\\")	=> "c:\\"

-- 
Nobu Nakada