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.
19
20     This function adds an entry to the archive.  It does not check whether a
21     directory with that name exists in the file system, nor does it add its
22     contents if it does.  The flags argument can be any of:
23
24     ZIP_FL_ENC_GUESS      Guess encoding of name (default).  (Only CP-437 and
25                           UTF-8 are recognized.)
26
27     ZIP_FL_ENC_UTF_8      Interpret name as UTF-8.
28
29     ZIP_FL_ENC_CP437      Interpret name as code page 437 (CP-437).
30

RETURN VALUES

32     Upon successful completion, the index of the new entry in the archive is
33     returned.  Otherwise, -1 is returned and the error code in archive is set
34     to indicate the error.
35

ERRORS

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

SEE ALSO

47     libzip(3), zip_file_add(3)
48

HISTORY

50     zip_dir_add() was added in libzip 0.11.
51

AUTHORS

53     Dieter Baron <dillo@nih.at> and Thomas Klausner <tk@giga.or.at>
54
55BSD                           September 20, 2020                           BSD
Impressum