---
name: "zip_get_num_entries"
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_get_num_entries"
---

# zip\_get\_num\_entries(3)

get number of entries in archive

## NAME

**zip\_get\_num\_entries** – get number of entries in archive

## LIBRARY

libzip (-lzip)

## SYNOPSIS

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

*zip\_int64\_t*\

**zip\_get\_num\_entries**(*zip\_t \*archive*, *zip\_flags\_t flags*);

## DESCRIPTION

The **zip\_get\_num\_entries**() function returns the number of entries in *archive*. Entries are all files that are present in the original archive or that were added while the archive is open. This includes deleted files, since indices are not renumbered until the archive is closed. (This allows one to refer to deleted files, e. g. to undelete them.)

If *flags* is set to ZIP\_FL\_UNCHANGED, the original number of files is returned.

## RETURN VALUES

**zip\_get\_num\_entries**() returns the number of entries in the zip archive, or -1 if *archive* is NULL.

## SEE ALSO

[libzip(3)](/libzip/3.md), [zip\_fopen\_index(3)](/zip_fopen_index/3.md), [zip\_stat\_index(3)](/zip_stat_index/3.md)

## HISTORY

**zip\_get\_num\_entries**() was added in libzip 0.10. In libzip 0.11 the return type was changed from *zip\_uint64\_t* to *zip\_int64\_t*. In libzip 0.11 the type of *flags* was changed from *int* to *zip\_flags\_t*.

## AUTHORS

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