ddn.archive.tar
ddn.archive.tar
TAR archive reader and writer implementing ddn.api.archive.
Supports reading and writing POSIX TAR archives in ustar, pax, and GNU formats. Implements the streaming ArchiveReader and ArchiveWriter interfaces.
Provider name convention: vendor "ddn", toString() returns "ddn-tar".
Copyright
BSD-3-Clause
Module Initializers 1
shared static this
()Types 2
classTarReader : ArchiveReader
TAR archive reader implementing ArchiveReader.
Reads from an in-memory byte slice. Supports ustar, GNU, and basic V7 formats.
Methods
void setProgressCallback(ArchiveProgressCallback callback)bool contains(string path)void readContent(const EntryInfo entry, ContentSink sink)void extractAll(string destDir)void close()Constructors
this(const(ubyte)[] data, ReadOptions opts)Create a TAR reader from archive data.classTarWriter : ArchiveWriter
TAR archive writer implementing ArchiveWriter.
Produces a ustar-format TAR archive stream via a ContentSink.
Methods
void setOutputSink(ContentSink sink)void setProgressCallback(ArchiveProgressCallback callback)void addDirectory(string path,
FilePermissions perms = FilePermissions.fromOctal(octal!"755"))void addFile(string path, const(ubyte)[] content,
EntryWriteOptions opts = EntryWriteOptions.init)void addFile(string path, scope const(ubyte)[] delegate() source,
ulong size = 0, EntryWriteOptions opts = EntryWriteOptions.init)void addFileFrom(string archivePath, string filesystemPath,
EntryWriteOptions opts = EntryWriteOptions.init)void addSymlink(string path, string target)void addHardlink(string path, string target)void setComment(string comment)void removeEntry(string path)void updateEntry(string path, const(ubyte)[] content,
EntryWriteOptions opts = EntryWriteOptions.init)void finish()void close()Constructors
this(ContentSink sink, WriteOptions opts)Create a TAR writer.Functions 3
fn
ArchiveReader makeTarReader(const(ubyte)[] data, ReadOptions opts)Factory function that constructs a TarReader.fn
ArchiveWriter makeTarWriter(ContentSink sink, WriteOptions opts)Factory function that constructs a TarWriter.