C Library for Managing Compression File Formats

Open Source C Library to Create, Edit, Delete & Extract ZIP Archives inside your own apps. 

Libzip is an open source C library that gives software developers the capability to create and modify ZIP archives inside their own applications with minimum effort. The developers can easily add files from data buffers as well as different files, or compressed data copied directly from other zip archives. It also supports to revert changes made without closing the archive. Moreover, the library also supports encryption and decryption of Winzip AES and legacy PKware.

The API is well documented and can be easily accessed.  The API provides complete support for several advanced compression and extraction related features for ZIP and ZIP64 archives, such as adding a file to or replacing the file in a ZIP archive, adding a directory to a ZIP archive, delete a file from a ZIP archive, file encryption, and decryption support, last modification time, open file in a ZIP archive for reading, write data to zip source & many more.

Previous Next

Getting Started with libzip

CMake is highly recommended to build the libzip library. You can get it from the cmake website easily.

A typical installation code is given below

Compile zip Library for Basic Usage

mkdir build
cd build
cmake ..
make test
make install 

Add or Replace File in a ZIP archive

Managing a ZIP archive in their own applications is always the demand of IT companies as well as individuals. The libzip library provides these features facilitating computer programmers by allowing them to add a file to a ZIP archive as well as replace or delete files in an existing ZIP archive with ease. The available methods are very user-friendly and you require just a couple of lines of code to achieve this task.

Create a New Archive via C Library

The libzip library allows developers to generate a new zip archive inside their own C applications. You can also modify an existing ZIP archive by adding or editing files inside it. The library gives complete control to users by allowing them to view a list of files inside the ZIP archive, delete a directory or file in a ZIP archive, open or close files, and many more.

Read and Extract Files in a ZIP Archive

The open source libzip library facilitates users to easily read and extract the contents of a ZIP archive. The library supports extracting files and folders into a place of your choice with just a couple of lines of C code. The library provides support for extracting the complete data inside the archive as well as extracting specific files of your choice.

More Control over ZIP Archive

The zip library provides several important features for better control over the contents of a ZIP archive. Several methods and properties are available that can help users to get complete information about the archive before extracting its contents. It supports features like counting the number of files in an archive, iterating through all the files in an archive, extracting only selected files, removing files from an archive, and many more.