UCE Docs / zip_list

Signature

DValue zip_list(String zip_file_name)

Parameters

zip_file_name : path to the ZIP archive to inspect
return value : DValue containing archive metadata and an entries array

Reads the central directory from zip_file_name and returns structured metadata.

The returned tree contains:

  • file : archive path

  • count : number of entries

  • entries : list of entry metadata

Each entry contains:

  • name

  • index

  • size

  • compressed_size

  • is_directory

  • method

Example:

Example

DValue entries;
entries["a.txt"] = "alpha";
entries["b.txt"] = "beta";
zip_create("/tmp/doc-ziplist.zip", entries);
DValue listing = zip_list("/tmp/doc-ziplist.zip");
String names = "";
listing["entries"].each([&](DValue e, String key) {
    names += (names == "" ? "" : ", ") + e["name"].to_string();
});
print(listing["count"].to_u64(), " entries: ", names, "\n");
Output
2 entries: a.txt, b.txt