1ZIP_STAT(3)                Library Functions Manual                ZIP_STAT(3)
2
3
4

NAME

6       zip_stat , - .Nm zip_stat_index get information about file
7

LIBRARY

9       libzip (-lzip)
10

SYNOPSIS

12       #include <zip.h>
13
14       int  zip_stat(struct zip *archive, const char *fname, int flags, struct
15       zip_stat *sb);
16
17       int zip_stat_index(struct zip *archive, int index,  int  flags,  struct
18       zip_stat *sb);
19

DESCRIPTION

21       The zip_stat function obtains information about the file named fname in
22       archive.  The flags argument specifies how the name  lookup  should  be
23       done.    Its   values   are  described  in  zip_name_locate(3).   Also,
24       ZIP_FL_UNCHANGED may be or'ed to it to request  information  about  the
25       original file in the archive, ignoring any changes made.
26
27       The zip_stat_index function obtains information about the file at posi‐
28       tion index.
29
30       The sb argument is a pointer to a
31
32       struct zip_stat (shown below), into which information about the file is
33       placed.  struct zip_stat {
34           const char *name;              /* name of the file */
35           int index;                /* index within archive */
36           unsigned int crc;              /* crc of file data */
37           unsigned int size;             /* size of file (uncompressed) */
38           time_t mtime;             /* modification time */
39           unsigned int comp_size;        /* size of file (compressed) */
40           unsigned short comp_method;         /* compression method used */
41           unsigned short encryption_method;   /* encryption method used */ };
42

RETURN VALUES

44       Upon  successful  completion  0 is returned.  Otherwise, -1 is returned
45       and the error information in archive is set to indicate the error.
46

ERRORS

48       The function zip_stat can fail for any of the errors specified for  the
49       routine zip_name_locate(3).
50
51       The  function  zip_stat_index  fails  and sets the error information to
52       ZIP_ER_INVAL if index is invalid.  If ZIP_FL_UNCHANGED is not  set  and
53       no  information  can  be  obtained  from the source callback, the error
54       information is set to ZIP_ER_CHANGED.
55

SEE ALSO

57       libzip(3), zip_name_locate(3), zip_stat_init(3)
58

AUTHORS

60       Dieter Baron <dillo@giga.or.at> and Thomas Klausner <tk@giga.or.at>
61
62
63
64NiH                            December 16, 2006                   ZIP_STAT(3)
Impressum