listArchive

fnvoid listArchive(const ArchiveHandle h, scope void delegate(string path, ListEntry entry) @safe cb) @safe

Lists archive entries, invoking the provided callback for each one.

This function iterates over all entries in the archive catalog and invokes the callback with the full path and entry metadata for each item.

Parameters

harchive handle obtained from openArchiveRead
cbdelegate called for each entry with (path, ListEntry)

Throws

DarException if the archive handle is invalid or listing fails.

Example:

auto archive = openArchiveRead("/backups", "myarchive", "dar");

// List all entries
listArchive(archive, (path, entry) {
    writefln("%s %s (%d bytes)", entry.type, entry.name, entry.size);
});

// Collect entries into an array
ListEntry[] entries;
listArchive(archive, (path, entry) {
    entries ~= entry;
});
writefln("Archive contains %d entries", entries.length);