struct zip * zip_open(const char *path, int flags, int *errorp);
DESCRIPTIONThe zip archive specified by path is opened and a pointer to a
struct zip, used to manipulate the archive, is returned. The are specified by or'ing the following values, or 0 for none of them.
- Create the archive if it does not exist.
- Error if archive already exists.
- Perform additional consistency checks on the archive, and error if they fail.
If an error occurs and errorp is non-NULL, it will be set to the corresponding error code.
RETURN VALUESUpon successful completion zip_open returns a
struct zip pointer. Otherwise, NULL is returned and *errorp is set to indicate the error.
ERRORSThe archive specified by path is opened unless:
- The file specified by path exists and ZIP_EXCL is set.
- Inconsistencies were found in the file specified by path and ZIP_CHECKCONS was specified.
- The path argument is NULL.
- Required memory could not be allocated.
- The file specified by path does not exist and ZIP_CREATE is not set.
- The file specified by path is not a zip archive.
- The file specified by path could not be opened.
- A read error occurred; see errno for details.
- The file specified by path does not allow seeks.