---
name: "zip_get_file_extra"
section: "3"
platform: "linux"
package: "libzip-dev"
version: "0.10.1-1.1"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/zip_get_file_extra"
---

# zip\_get\_file\_extra(3)

get extra field for file in zip

## NAME

zip\_get\_file\_extra - get extra field for file in zip

## LIBRARY

libzip (-lzip)

## SYNOPSIS

\#include \<zip.h\>

const char \* zip\_get\_file\_extra(struct zip \*archive, zip\_uint64\_t index); "int \*lenp" "int flags"

## DESCRIPTION

The zip\_get\_file\_extra function returns the extra field for the file at position **index** in the zip archive. This pointer should not be modified or [free(3)](/free/3.md) Ap d. If **lenp** is not **NULL,** the integer to which it points will be set to the length of the extra. If **flags** is set to **ZIP\_FL\_UNCHANGED,** the original unchanged extra field is returned.

## RETURN VALUES

Upon successful completion, a pointer to the extra field is returned, or **NULL** if there is no extra field. In case of an error, **NULL** is returned and the error code in **archive** is set to indicate the error.

## ERRORS

zip\_get\_file\_extra fails if:

- \[ZIP\_ER\_INVAL\]

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

## SEE ALSO

[libzip(3)](/libzip/3.md), [zip\_set\_file\_extra(3)](/zip_set_file_extra/3.md)

## AUTHORS

Dieter Baron \<dillo@giga.or.at\> and Thomas Klausner \<tk@giga.or.at\>
