archive.tar

$(DDOC_SECTIONS Functions and types that implement the TarPolicy used with the Archive template.

License:
.

Authors:
Richard W Laughlin Jr.

Source:


http:
//github.com/rcythr/archive

Policy for the Archive template which provides reading and writing of Tar files.

Reading Usage:
import archive.tar;
import std.stdio;

auto archive = new TarArchive(std.file.read("my.tar");

foreach(file; archive.files)
{
    writeln("Filename: ", file.path);
    writeln("Data: ", file.data);
}

)


Writing Usage:
import archive.tar;

auto archive = new TarArchive();

auto file = new TarArchive.File("languages/awesome.txt");
file.data = "D\n"; // can also set to immutable(ubyte)[]
archive.addFile(file);

std.file.write("lang.tar", cast(ubyte[])archive.serialize());



class TarException: object.Exception;
Thrown when a tar file is not readable or contains errors.

struct TarPermissions;
Helper struct for unix permissions

enum TarTypeFlag: char;
Enum class for types supported by tar files. Directory is given special treatment, all others have any content placed in the data field.

class TarPolicy;
Policy class for reading and writing tar archives.

Features:
+ Handles files and directories of arbitrary size + Files and directories may have permissions + Files and directories may optionally set an owner and group name/id.

Limitations:
+ File paths may not exceed 255 characters - this is due to the format specification.

class DirectoryImpl: archive.core.ArchiveDirectory!(TarPolicy).ArchiveDirectory;
Class for directories

class FileImpl: archive.core.ArchiveMember;
Class for files

void deserialize(Filter)(void[] data, Archive!(TarPolicy, Filter) archive);
Deserialize method which loads data from a tar archive.

void[] serialize(Filter)(Archive!(TarPolicy, Filter) archive);
Serialize method which writes data to a tar archive

alias TarArchive = archive.core.Archive!(TarPolicy, NullArchiveFilter).Archive;
Convenience alias that simplifies the interface for users


Page generated by Ddoc. Copyright Richard W Laughlin Jr. 2014—2016