'Performs a stat on a file or directory.
Args:
path: The path to stat.
fh: A file handler. Not used.
Returns:
A dictionary mapping st_ names to their values.
Raises:
FuseOSError: When a path is supplied that grr doesn\'t know about, ie an
invalid file path.
ValueError: If an empty path is passed. (The empty string, when passed to
self.root.Add, returns a path for aff4:/, the root directory, which is not
the behaviour we want.)'

def Getattr(self, path, fh=None):

    if (not path):
        raise fuse.FuseOSError(errno.ENOENT)
    if (path != self.root):
        full_path = self.root.Add(path)
    else:
        full_path = path
    fd = aff4.FACTORY.Open(full_path, token=self.token)
    if (full_path == '/'):
        return self.MakePartialStat(fd)
    fd = aff4.FACTORY.Open(full_path, token=self.token)
    aff4_stat = fd.Get(fd.Schema.STAT)
    if aff4_stat:
        return aff4_stat.AsDict()
    elif (fd.Get(fd.Schema.LAST) is None):
        raise fuse.FuseOSError(errno.ENOENT)
    else:
        pass
    return self.MakePartialStat(fd)
