小编Rod*_*rba的帖子

LIBZIP 是否提供了检查 zip_file 是否为目录的方法?

由于兼容性问题,我使用的是相当旧的 libzip 版本(0.10.1-1.2)。

通常我们通过统计结果来检查文件类型(符号链接、目录、文件等)。类似地,在 libzip 上,我们使用 zip_stat,但其结构不包含文件系统 STAT 中的 ST_MOD 之类的内容。

struct zip_stat {
    zip_uint64_t valid;         /* which fields have valid values */
    const char *name;           /* name of the file */
    zip_uint64_t index;         /* index within archive */
    zip_uint64_t size;          /* size of file (uncompressed) */
    zip_uint64_t comp_size;     /* size of file (compressed) */
    time_t mtime;           /* modification time */
    zip_uint32_t crc;           /* crc of file data */
    zip_uint16_t comp_method;       /* compression method used */
    zip_uint16_t encryption_method; /* encryption …
Run Code Online (Sandbox Code Playgroud)

c++ ubuntu zip libzip

2
推荐指数
1
解决办法
1111
查看次数

标签 统计

c++ ×1

libzip ×1

ubuntu ×1

zip ×1