def MakeStatResponse(self, tsk_file, tsk_attribute=None, append_name=False):
    info = tsk_file.info
    response = rdf_client.StatEntry()
    meta = info.meta
    if meta:
      response.st_ino = meta.addr
      for attribute in ["mode",
                        "nlink",
                        "uid",
                        "gid",
                        "size",
                        "atime",
                        "mtime",
                        "ctime",
                        "crtime"]:
        try:
          value = int(getattr(meta, attribute))
          if value < 0: value &= 0xFFFFFFFF

          setattr(response, "st_%s" % attribute, value)
        except AttributeError:
          pass

    name = info.name
    child_pathspec = self.pathspec.Copy()

    if append_name:
      # Append the name to the most inner pathspec
      child_pathspec.last.path = utils.JoinPath(child_pathspec.last.path,
                                                utils.SmartUnicode(append_name))

    child_pathspec.last.inode = meta.addr
    if tsk_attribute is not None:
      child_pathspec.last.ntfs_type = int(tsk_attribute.info.type)
      child_pathspec.last.ntfs_id = int(tsk_attribute.info.id)
      child_pathspec.last.stream_name = tsk_attribute.info.name

      # Update the size with the attribute size.
      response.st_size = tsk_attribute.info.size

      default = rdf_paths.PathSpec.tsk_fs_attr_type.TSK_FS_ATTR_TYPE_DEFAULT
      last = child_pathspec.last
      if last.ntfs_type != default or last.ntfs_id:
        # This is an ads and should be treated as a file.
        # Clear all file type bits.
        response.st_mode &= ~self.stat_type_mask
        response.st_mode |= stat.S_IFREG

    else:
      child_pathspec.last.ntfs_type = None
      child_pathspec.last.ntfs_id = None
      child_pathspec.last.stream_name = None

    if name:
      # Encode the type onto the st_mode response
      response.st_mode |= self.FILE_TYPE_LOOKUP.get(int(name.type), 0)

    if meta:
      # What if the types are different? What to do here?
      response.st_mode |= self.META_TYPE_LOOKUP.get(int(meta.type), 0)

    # Write the pathspec on the response.
    response.pathspec = child_pathspec
    return response
Load or reload the specified module.
dataset/ETHPy150Open google/grr/grr/client/vfs_handlers/sleuthkit.py/TSKFile.MakeStatResponse--crossover with--dataset/ETHPy150Open CollabQ/CollabQ/.google_appengine/google/appengine/dist/py_imp.py/load_module