Issue #6587 has been updated by matz (Yukihiro Matsumoto).

Status changed from Assigned to Rejected


----------------------------------------
Feature #6587: proposal: adding new methods File.rootname and Pathname#rootname
https://bugs.ruby-lang.org/issues/6587#change-28166

Author: usa (Usaku NAKAMURA)
Status: Rejected
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: 2.0.0


=begin
??????大好?? Unixen ?????????????? '/' ?????????????????????????????????????????????????Windows ?????????????????????? UNC ???????????????????????????????????????????????????????????????????????????????????????
Ruby ??????????????? UNC ???????????????????????????????????????????????????念?????????????????????????????????????????????????????????????????????????????????
??????? ruby ???????? test/ 以??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????UNC ?????張???????(???????????????????????????????????????????????????"//?/" ???????????? "//./" ??????????????)?????????????????????????????????????????????????????

??????????(({dirname}))???(({basename}))???(({extname})) ?????????????????(({rootname})) ?????????????????? (({File})) ???????????????????? (({Pathname})) ???????????????追??????????????????????????????

--- File.rootname(filename) -> String
    filename ??????????????????????????????????????????????????????????????????????????????????
    filename ?????対?????????????? ""(空??????)??????????????
     # on Unixen
     p File.rootname("/foo/bar.txt") #=> "/" (absolute path)
     p File.rootname("bar.txt")      #=> ""  (relative path)

     # on Windows
     p File.rootname("/foo/bar.txt")         #=> "" (relative path)
     p File.rootname("bar.txt")              #=> "" (relative path)
     p File.rootname("C:/foo/bar.txt")       #=> "C:/" (normal absolute path)
     p File.rootname("C:bar.txt")            #=> "" (relative path)
     p File.rootname("//host/share/baz.txt") #=> "//host/share" (UNC absolute path)
     p File.rootname("//?/C:/foo/bar.txt")   #=> "//?/C:/" (extended form absolute path)

--- Pathname#rootname
    Pathname.new(File.rootname(self.to_s)) ??????????????
=end



-- 
http://bugs.ruby-lang.org/