1ZIP_DIR_ADD(3)           BSD Library Functions Manual           ZIP_DIR_ADD(3)
2

NAME

4     zip_dir_add — add directory to zip archive
5

LIBRARY

7     libzip (-lzip)
8

SYNOPSIS

10     #include <zip.h>
11
12     zip_int64_t
13     zip_dir_add(zip_t *archive, const char *name, zip_flags_t flags);
14

DESCRIPTION

16     The function zip_dir_add() adds a directory to a zip archive.  The argu‐
17     ment archive specifies the zip archive to which the directory should be
18     added.  name is the directory's name in the zip archive.  The flags argu‐
19     ment can be any of:
20
21     ZIP_FL_ENC_GUESS      Guess encoding of name (default).
22
23     ZIP_FL_ENC_UTF_8      Interpret name as UTF-8.
24
25     ZIP_FL_ENC_CP437      Interpret name as code page 437 (CP-437).
26

RETURN VALUES

28     Upon successful completion, the index of the new entry in the archive is
29     returned.  Otherwise, -1 is returned and the error code in archive is set
30     to indicate the error.
31

ERRORS

33     zip_dir_add() fails if:
34
35     [ZIP_ER_EXISTS]    There is already an entry called name in the archive.
36
37     [ZIP_ER_INVAL]     archive or name are NULL, or invalid UTF-8 encoded
38                        file names.
39
40     [ZIP_ER_MEMORY]    Required memory could not be allocated.
41

SEE ALSO

43     libzip(3), zip_file_add(3)
44

HISTORY

46     zip_dir_add() was added in libzip 0.11.
47

AUTHORS

49     Dieter Baron <dillo@nih.at> and Thomas Klausner <tk@giga.or.at>
50

CAVEATS

52     zip_dir_add() does not look in the file system, it just creates one entry
53     in the archive for the provided name.
54
55BSD                            December 18, 2017                           BSD
Impressum