---
name: "zip_set_archive_comment"
section: "3"
platform: "linux"
package: "libzip"
version: "1.11.4-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/zip_set_archive_comment"
---

# zip\_set\_archive\_comment(3)

set zip archive comment

## NAME

**zip\_set\_archive\_comment** – set zip archive comment

## LIBRARY

libzip (-lzip)

## SYNOPSIS

**#include \<zip.h\>**

*int*\

**zip\_set\_archive\_comment**(*zip\_t \*archive*, *const char \*comment*, *zip\_uint16\_t len*);

## DESCRIPTION

The **zip\_set\_archive\_comment**() function sets the comment for the entire zip archive. If *comment* is NULL and *len* is 0, the archive comment will be removed. *comment* must be encoded in ASCII or UTF-8.

## RETURN VALUES

Upon successful completion 0 is returned. Otherwise, -1 is returned and the error information in *archive* is set to indicate the error.

## ERRORS

**zip\_set\_archive\_comment**() fails if:

- \[ZIP\_ER\_INVAL\]

  *len* is less than 0 or longer than the maximum comment length in a zip file (65535), or *comment* is not a valid UTF-8 encoded string.

- \[ZIP\_ER\_MEMORY\]

  Required memory could not be allocated.

## SEE ALSO

[libzip(3)](/libzip/3.md), [zip\_file\_get\_comment(3)](/zip_file_get_comment/3.md), [zip\_file\_set\_comment(3)](/zip_file_set_comment/3.md), [zip\_get\_archive\_comment(3)](/zip_get_archive_comment/3.md)

## HISTORY

**zip\_set\_archive\_comment**() was added in libzip 0.7. In libzip 0.11 the type of *len* was changed from *int* to *zip\_uint16\_t*.

## AUTHORS

Dieter Baron ⟨*dillo@nih.at*⟩ and Thomas Klausner ⟨*wiz@gatalith.at*⟩
