def METHOD_NAME(self, filename: pathlib.Path | str, comment: str) -> bool:
    """
    This is a custom function for writing a comment to a zip file,
    since the built-in one doesn't seem to work on Windows and Mac OS/X
    Fortunately, the zip comment is at the end of the file, and it's
    easy to manipulate.  See this website for more info:
    see: http://en.wikipedia.org/wiki/Zip_(file_format)#Structure
    """
    # get file size
    statinfo = os.stat(filename)
    file_length = statinfo.st_size
    try:
        with open(filename, mode="r+b") as file:
            # the starting position, relative to EOF
            pos = -4
            found = False
            # walk backwards to find the "End of Central Directory" record
            while (not found) and (-pos != file_length):
                # seek, relative to EOF
                file.seek(pos, 2)
                value = file.read(4)
                # look for the end of central directory signature
                if bytearray(value) == bytearray([0x50, 0x4B, 0x05, 0x06]):
                    found = True
                else:
                    # not found, step back another byte
                    pos = pos - 1
            if found:
                # now skip forward 20 bytes to the comment length word
                pos += 20
                file.seek(pos, 2)
                # Pack the length of the comment string
                fmt = "H"  # one 2-byte integer
                comment_length = struct.pack(fmt, len(comment))  # pack integer in a binary string
                # write out the length
                file.write(comment_length)
                file.seek(pos + 2, 2)
                # write out the comment itself
                file.write(comment.encode("utf-8"))
                file.truncate()
            else:
                raise Exception("Could not find the End of Central Directory record!")
    except Exception as e:
        logger.error("Error writing comment to zip archive [%s]: %s", e, self.path)
        return False
    else:
        return True