---
name: "zip_error_to_str"
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_error_to_str"
---

# zip\_error\_to\_str(3)

get string representation of zip error (obsolete interface)

## NAME

**zip\_error\_to\_str** – get string representation of zip error (obsolete interface)

## LIBRARY

libzip (-lzip)

## SYNOPSIS

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

*int*\

**zip\_error\_to\_str**(*char \*buf*, *zip\_uint64\_t len*, *int ze*, *int se*);

## DESCRIPTION

The function **zip\_error\_to\_str**() is deprecated; use [zip\_error\_init\_with\_code(3)](/zip_error_init_with_code/3.md) and [zip\_error\_strerror(3)](/zip_error_strerror/3.md) instead.

Replace

```
char buf[BUFSIZE];
zip_error_to_str(buf, sizeof(buf), ze, se);
printf("%s", buf);
```

with

```
zip_error_t error;
zip_error_init_with_code(&error, ze);
printf("%s", zip_error_strerror(&error));
zip_error_fini(&error);
```

## SEE ALSO

[libzip(3)](/libzip/3.md), [zip\_error\_init\_with\_code(3)](/zip_error_init_with_code/3.md), [zip\_error\_strerror(3)](/zip_error_strerror/3.md)

## HISTORY

**zip\_error\_to\_str**() was added in libzip 0.6. In libzip 0.10 the type of *len* was changed from *size\_t* to *zip\_uint64\_t*. It was deprecated in libzip 1.0, use **zip\_error\_init\_with\_code**() and **zip\_error\_strerror**() instead.

## AUTHORS

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