---
name: "zip_source_seek"
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_seek"
---

# zip\_source\_seek(3)

set read offset in zip source

## NAME

**zip\_source\_seek** – set read offset in zip source

## LIBRARY

libzip (-lzip)

## SYNOPSIS

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

*int*\

**zip\_source\_seek**(*zip\_source\_t \*source*, *zip\_int64\_t offset*, *int whence*);

## DESCRIPTION

The function **zip\_source\_seek**() sets the current read offset for *source*. Just like in [fseek(3)](/fseek/3.md), depending on the *whence* argument, the *offset* is counted relative from:

- SEEK\_SET

  start of file

- SEEK\_CUR

  current read offset in file

- SEEK\_END

  end of file

## RETURN VALUES

Upon successful completion 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\_is\_seekable(3)](/zip_source_is_seekable/3.md), [zip\_source\_read(3)](/zip_source_read/3.md), [zip\_source\_tell(3)](/zip_source_tell/3.md)

## HISTORY

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

## AUTHORS

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