openCompressedArchive
fn
ArchiveReader 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
path | Path to the archive file. |
opts | Read options. |
Returns
An ArchiveReader for the (possibly decompressed) archive.
Throws
ArchiveError if the file cannot be read, decompression fails,
or no provider is registered.
fn
ArchiveReader 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
data | The archive data as a byte slice (possibly compressed). |
opts | Read options including format hint. |
Returns
An ArchiveReader for the (possibly decompressed) archive.
Throws
ArchiveError if decompression fails or no provider is registered.