---
name: "zip_source_read"
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_source_read"
---

# zip\_source\_read(3)

read data from zip source

## NAME

**zip\_source\_read** – read data from zip source

## LIBRARY

libzip (-lzip)

## SYNOPSIS

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

*zip\_int64\_t*\

**zip\_source\_read**(*zip\_source\_t \*source*, *void \*data*, *zip\_uint64\_t len*);

## DESCRIPTION

The function **zip\_source\_read**() reads up to *len* bytes of data from *source* at the current read offset into the buffer *data*.

The zip source *source* has to be opened for reading by calling [zip\_source\_open(3)](/zip_source_open/3.md) first.

## RETURN VALUES

Upon successful completion the number of bytes read is returned. When **zip\_source\_read**() is called after reaching the end of the file, 0 is returned. Otherwise, -1 is returned and the error information in *source* is set to indicate the error.

## SEE ALSO

[libzip(3)](/libzip/3.md), [zip\_source(5)](/zip_source/5.md), [zip\_source\_seek(3)](/zip_source_seek/3.md), [zip\_source\_tell(3)](/zip_source_tell/3.md), [zip\_source\_write(3)](/zip_source_write/3.md)

## HISTORY

**zip\_source\_read**() was added in libzip 1.0.

## AUTHORS

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