---
name: "zip_replace"
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_replace"
---

# zip\_replace(3)

add file to zip archive or replace file in zip archive (obsolete interface)

## NAME

**zip\_add**, **zip\_replace** – add file to zip archive or replace file in zip archive (obsolete interface)

## LIBRARY

libzip (-lzip)

## SYNOPSIS

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

*zip\_int64\_t*\

**zip\_add**(*zip\_t \*archive*, *const char \*name*, *zip\_source\_t \*source*);

*int*\

**zip\_replace**(*zip\_t \*archive*, *zip\_uint64\_t index*, *zip\_source\_t \*source*);

## DESCRIPTION

The function **zip\_add**() is the obsolete version of [zip\_file\_add(3)](/zip_file_add/3.md). It is the same as calling [zip\_file\_add(3)](/zip_file_add/3.md) with an empty *flags* argument. Similarly, the **zip\_replace**() function is the obsolete version of [zip\_file\_replace(3)](/zip_file_replace/3.md). It is the same as calling [zip\_file\_replace(3)](/zip_file_replace/3.md) with an empty *flags* argument.

## SEE ALSO

[libzip(3)](/libzip/3.md), [zip\_file\_add(3)](/zip_file_add/3.md), [zip\_file\_replace(3)](/zip_file_replace/3.md)

## HISTORY

**zip\_add**() was added in libzip 0.6. In libzip 0.10 the return type was changed from *int* to *zip\_int64\_t*. It was deprecated in libzip 0.11, use **zip\_file\_add**() instead.

**zip\_replace**() was added in libzip 0.6. In libzip 0.10 the type of *index* was changed from *int* to *zip\_uint64\_t*. It was deprecated in libzip 0.11, use **zip\_file\_replace**() instead.

## AUTHORS

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