def Dirname(self):
    'Get a new copied object with only the directory path.'
    result = self.Copy()
    while 1:
        last_directory = posixpath.dirname(result.last.path)
        if ((last_directory != '/') or (len(result) <= 1)):
            result.last.path = last_directory
            result.last.inode = None
            break
        result.Pop((- 1))
    return result
Get a new copied object with only the directory path.
def Dirname(self):
    
    result = self.Copy()
    while 1:
        last_directory = posixpath.dirname(result.last.path)
        if ((last_directory != '/') or (len(result) <= 1)):
            result.last.path = last_directory
            result.last.inode = None
            break
        result.Pop((- 1))
    return result