# File lib/pathname2.rb, line 496 def root dir = "." if @win buf = 0.chr * MAXPATH buf[0..self.length-1] = self if PathStripToRoot(buf) dir = buf.split(0.chr).first end else dir = "/" if self =~ /^\// end self.class.new(dir) end