extractArchive

fnvoid extractArchive(const ArchiveHandle h, string outDir) @safe

Extracts the archive contents to the provided output directory.

This function restores all files and directories from the archive to the specified destination, preserving the original directory structure and file attributes where possible.

Parameters

harchive handle obtained from openArchiveRead
outDirdestination directory for extracted files

Throws

DarException if extraction fails (permission denied, disk full,

invalid archive handle, corrupted data).

Example:

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

// Extract to a specific directory
extractArchive(archive, "/home/user/restored");

// Extract with custom read options (e.g., encrypted archive)
auto ro = ReadOptions.create();
ro.setPassword("secret");
auto encArchive = openArchiveRead("/backups", "secure", "dar", ro);
extractArchive(encArchive, "/home/user/decrypted");

fnvoid extractArchive(const ArchiveHandle h, string outDir, ExtractOptions eo) @safe

Extract archive using custom ExtractOptions.