def METHOD_NAME(self):
    md5_handler = get_handler("md5")
    outfile = None
    try:
        outfile = self._get_fd(True)
        for obj in sorted(self):
            if obj.is_reg:
                s = " ".join(
                    (
                        "obj",
                        obj.location,
                        md5_handler.long2str(obj.chksums["md5"]),
                        str(int(obj.mtime)),
                    )
                )
            elif obj.is_sym:
                s = " ".join(
                    ("sym", obj.location, "->", obj.target, str(int(obj.mtime)))
                )
            elif obj.is_dir:
                s = "dir " + obj.location
            elif obj.is_dev:
                s = "dev " + obj.location
            elif obj.is_fifo:
                s = "fif " + obj.location
            else:
                raise Exception(f"unknown type {type(obj)}: {obj}")
            outfile.write(s + "\n")
        outfile.close()
    finally:
        # if atomic, it forces the update to be wiped.
        del outfile