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).
25
26     ZIP_FL_ENC_UTF_8      Interpret name as UTF-8.
27
28     ZIP_FL_ENC_CP437      Interpret name as code page 437 (CP-437).
29

RETURN VALUES

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

ERRORS

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

SEE ALSO

46     libzip(3), zip_file_add(3)
47

HISTORY

49     zip_dir_add() was added in libzip 0.11.
50

AUTHORS

52     Dieter Baron <dillo@nih.at> and Thomas Klausner <tk@giga.or.at>
53
54BSD                             April 25, 2020                             BSD
Impressum