---
name: "zip_delete"
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_delete"
---

# zip\_delete(3)

delete file from zip archive

## NAME

**zip\_delete** – delete file from zip archive

## LIBRARY

libzip (-lzip)

## SYNOPSIS

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

*int*\

**zip\_delete**(*zip\_t \*archive*, *zip\_uint64\_t index*);

## DESCRIPTION

The file at position *index* in the zip archive *archive* is marked as deleted.

## RETURN VALUES

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

## ERRORS

**zip\_delete**() fails if:

- \[ZIP\_ER\_INVAL\]

  *index* is not a valid file index in *archive*.

## SEE ALSO

[libzip(3)](/libzip/3.md), [zip\_unchange(3)](/zip_unchange/3.md)

## HISTORY

**zip\_delete**() was added in libzip 0.6. In libzip 0.10 the type of *index* was changed from *int* to *zip\_uint64\_t*.

## AUTHORS

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