createCompressedArchive
fn
ArchiveWriter createCompressedArchive(string path, ArchiveFormat archiveFormat,
CompressionFormat compressionFormat, WriteOptions opts = WriteOptions.init)Create a compressed archive (e.g., .tar.gz).
Creates an archive writer that buffers the archive output and compresses it before writing to the file. The returned writer behaves like a normal ArchiveWriter; compression happens automatically when finish() or close() is called.
Parameters
path | Output file path. |
archiveFormat | The archive format (e.g., TAR). |
compressionFormat | The compression format (e.g., GZIP). |
opts | Additional write options. |
Returns
An ArchiveWriter that produces a compressed archive.
Throws
ArchiveError if parameters are invalid or no provider is registered.
fn
ArchiveWriter createCompressedArchive(ContentSink sink, ArchiveFormat archiveFormat,
CompressionFormat compressionFormat, WriteOptions opts = WriteOptions.init)Create a compressed archive writing to a ContentSink.
Creates an archive writer that buffers the archive output and compresses it before writing to the sink. The returned writer behaves like a normal ArchiveWriter; compression happens automatically when finish() or close() is called.
Parameters
sink | Output sink that receives the compressed archive bytes. |
archiveFormat | The archive format (e.g., TAR). |
compressionFormat | The compression format (e.g., GZIP). |
opts | Additional write options. |
Returns
An ArchiveWriter that produces a compressed archive via the sink.
Throws
ArchiveError if parameters are invalid or no provider is registered.