Archive instance wrapping the opened archive.Archive.open
Archive open(string path, string base, string ext, ReadOptions ro) @safeOpens 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
path | directory containing the archive slices |
base | archive base name (without slice number and extension) |
ext | slice extension (e.g., "dar") |
ro | read options constructed via ReadOptions.create() or readOpts().toLow() |
Returns
A new
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);