Capy-Bearer Documentation

zip_list

lib call

Capy

function zip_list(path : string) any

Description

zip_list() reads an archive file, not a string of archive bytes. The result value has file, count, and an entries list. Each entry has name, index, size, compressed_size, is_directory, and method. Sizes count bytes. Metadata numbers use f64.

Listing does not decompress entries or validate their content checksums. It does not certify that entry names are safe for extraction.

Missing or malformed archives and configured limits return a failure. Default limits are 64 MiB of archive input and 4,096 entries.

Parameters

path : archive path

Return Values

{ok: true, value: ...} on success, or {ok: false, error: "..."} on failure. The value field contains the archive metadata and entries.

Example

Capy

var archive := file_temp()
zip_create(archive, {"note.txt": "hello"})
var listing := zip_list(archive).value
print(listing.count, "\n")

Output

1