Archive.open

Archive open(string path, string base, string ext, ReadOptions ro) @safe

Opens an existing archive for reading.

This is a static factory method that opens an archive from disk and returns a high-level Archive wrapper.

Parameters

pathdirectory containing the archive slices
basearchive base name (without slice number and extension)
extslice extension (e.g., "dar")
roread options constructed via ReadOptions.create() or readOpts().toLow()

Returns

A new Archive instance wrapping the opened archive.

Throws

DarException if the archive cannot be opened (missing slices, wrong

password, permission denied, or corruption).

Example:

auto ro = readOpts()
             .withExtension("dar")
             .withPassword("secret")
             .toLow();
auto arc = Archive.open("/backups", "myarchive", "dar", ro);
if (arc.isValid)
    foreach (e; arc.list())
        writeln(e.name);