![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
Reading members out of a ZIP archive, to a file or into memory. More...
#include <stddef.h>#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | N_ZIP_MEMBER |
| What n_zip_find() says about a member. More... | |
Functions | |
| int | n_zip_extract (const char *path, const char *name, const char *out) |
| write a member out to a file, checking its CRC-32 | |
| int | n_zip_find (const char *path, const char *name, N_ZIP_MEMBER *member) |
| find a member by its full name in an archive's central directory | |
| int | n_zip_find_ending (const char *path, const char *ending, char *name, size_t name_len) |
| find the first member whose name ends with a given text, as a PyTorch checkpoint's "archive/data.pkl" whose folder name varies | |
| int | n_zip_read (const char *path, const char *name, size_t max_size, unsigned char **data, size_t *len) |
| read a member into memory, checking its CRC-32 | |
Reading members out of a ZIP archive, to a file or into memory.
What a program needs to take one file out of an archive it downloaded: find the member by name in the central directory, and write it out, stored or deflated, inflated a piece at a time so a member of hundreds of megabytes needs no more memory than its buffers, its CRC-32 checked. Read only; no ZIP64 (a member or an archive over 4 GiB is refused), no encryption, no other compression method.
Definition in file n_zip.h.