---
name: "zzip_read"
section: "3"
platform: "linux"
package: "libzzip-dev"
version: "0.13.78+dfsg.1-0.1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/zzip_read"
---

# zzip\_read(3)

read data.

## NAME

zzip\_read, zzip\_fread -  read data.

## SYNOPSIS

```
#include <zzip/lib.h>

zzip_ssize_t
zzip_read(ZZIP_FILE* fp, void* buf, zzip_size_t len)
zzip_size_t
zzip_fread(void* ptr, zzip_size_t size, zzip_size_t nmemb, ZZIP_FILE* file)
```

## DESCRIPTION

 The *zzip\_read* function will [read(2)](/read/2.md) data from a real/zipped file.

 The *zzip\_read* function is the replacement for *[read(2)](/read/2.md)* will fill the given buffer with bytes from the opened file. It will return the number of bytes read, so if the EOF is encountered you will be prompted with the number of bytes actually read.

 If the file-handle is wrapping a stat'able file then it will actually just perform a normal *[read(2)](/read/2.md)*-call, otherwise *zzip\_file\_read* is called to decompress the data stream and any error is mapped to *[errno(3)](/errno/3.md)*.

## AUTHOR

 Guido Draheim \<guidod@gmx.de\> Tomi Ollila \<Tomi.Ollila@iki.fi\>

## COPYRIGHT

 Copyright (c) Guido Draheim, use under copyleft (LGPL,MPL)
