Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages
ZIP_CLOSE(3) FreeBSD Library Functions Manual ZIP_CLOSE(3)

close zip archive

libzip (-lzip)

#include <zip.h>
zip_close(zip_t *archive);

The zip_close() function writes any changes made to archive to disk. If archive contains no files, the file is completely removed (no empty archive is written). If successful, archive is freed. If writing fails, zip_close() fails; archive is left unchanged and must still be freed.
To close and free a zip archive without saving changes, use zip_discard(3).

Upon successful completion 0 is returned. Otherwise, -1 is returned and the error code in archive is set to indicate the error.

zip_close() will fail if:
Unexpected end-of-file found while reading from a file.
The callback function of an added or replaced file returned an error but failed to report which.
The path argument is NULL.
Required memory could not be allocated.
File is not a zip archive.
A file read failed.
A temporary file could not be renamed to its final name.
A file seek failed.
A temporary file could not be created.
A file write failed.
An error occurred while (de)compressing a stream with zlib(3).
Additionally, any errors returned by the callback function for added or replaced files will be passed back.

libzip(3), zip_discard(3), zip_error_get(3), zip_fdopen(3), zip_open(3), zip_register_progress_callback_with_state(3), zip_strerror(3)

zip_close() was added in libzip 0.6.

Dieter Baron <> and Thomas Klausner <>
December 18, 2017 FreeBSD 12.0-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.