Manpages - zip_close.3

libzip (-lzip)

The

function writes any changes made to

to disk. If

contains no files, the file is completely removed (no empty archive is written). If successful,

is freed. Otherwise

is left unchanged and must still be freed.

To close and free a zip archive without saving changes, use

Progress updates for GUIs can be implemented using

Cancelling the write of an archive during

can be implemented using

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

is set to indicate the error.

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

argument is

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

Additionally, any errors returned by the callback function for added or replaced files will be passed back.

was added in libzip 0.6.

and

Author: dt

Created: 2022-02-21 Mon 13:43