openArchiveRead

fnArchiveHandle openArchiveRead(string path, string base, string ext, ReadOptions ro = null) @safe

Opens an archive for reading using minimal parameters.

This function opens an existing DAR archive and returns a handle that can be used for listing, extraction, and other read operations.

Parameters

pathdirectory containing slices
basebasename of the archive (without slice number and extension)
extslice extension (usually "dar")
rooptional read options created with ReadOptions.create(); pass null to use defaults

Returns

An ArchiveHandle for the opened archive.

Throws

DarException if the archive cannot be opened (file not found, permission denied,

corrupted archive, wrong password for encrypted archives).

Example:

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

// Open with custom options (e.g., for encrypted archives)
auto ro = ReadOptions.create();
ro.setExtension("dar");
ro.setPassword("secret");
auto encryptedArchive = openArchiveRead("/backups", "secure", "dar", ro);