'Writes the file footer (finished the file).'

def WriteFileFooter(self):

    if (not self._stream):
        raise ArchiveAlreadyClosedError('Attempting    to    write    to    a    ZIP    archive    that    was    already    closed.')
    if self.cur_cmpr:
        buf = self.cur_cmpr.flush()
        self.cur_compress_size += len(buf)
        self.cur_zinfo.compress_size = self.cur_compress_size
        self._stream.write(buf)
    else:
        self.cur_zinfo.compress_size = self.cur_file_size
    self.cur_zinfo.CRC = self.cur_crc
    self.cur_zinfo.file_size = self.cur_file_size
    cur_file_size = min(4294967295, self.cur_file_size)
    cur_compress_size = min(4294967295, self.cur_compress_size)
    self._stream.write(struct.pack('<LLL', self.cur_crc, cur_compress_size, cur_file_size))
    self._zip_fd.filelist.append(self.cur_zinfo)
    self._zip_fd.NameToInfo[self.cur_zinfo.filename] = self.cur_zinfo
    self._ResetState()
    return self._stream.GetValueAndReset()
