'return the directory path of the current path joined
with any given path arguments.'

def dirpath(self, *args, **kwargs):

    l = self.strpath.split(self.sep)
    if (len(l) < 4):
        raise py.error.EINVAL(self, 'base    is    not    valid')
    elif (len(l) == 4):
        return self.join(*args, **kwargs)
    else:
        return self.new(basename='').join(*args, **kwargs)
