openCompressedArchive

fnArchiveReader openCompressedArchive(string path, ReadOptions opts = ReadOptions.init)

Open a potentially compressed archive (handles .tar.gz, .tar.bz2, etc.).

If the data is a compressed archive, the outer compression layer is decompressed first, then the inner archive is opened.

Parameters

pathPath to the archive file.
optsRead options.

Returns

An ArchiveReader for the (possibly decompressed) archive.

Throws

ArchiveError if the file cannot be read, decompression fails,

or no provider is registered.

fnArchiveReader openCompressedArchive(const(ubyte)[] data, ReadOptions opts = ReadOptions.init)

Open a possibly compressed archive from an in-memory byte slice.

Detects compression wrappers (GZIP, BZIP2, XZ, LZ4, ZSTD) around archive formats such as TAR. If a compression layer is detected, the data is decompressed before opening the inner archive.

Parameters

dataThe archive data as a byte slice (possibly compressed).
optsRead options including format hint.

Returns

An ArchiveReader for the (possibly decompressed) archive.

Throws

ArchiveError if decompression fails or no provider is registered.