Skip to content

TTarWriter

Class to write tar archives.

Declaration

Source position: libtar.pp line 201

type

  TTarWriter = class
  public
    constructor Create(TargetStream: TStream); overload;
    constructor Create(const TargetFilename: AnsiString; 
                  Mode: Integer=fmCreate); overload;
    destructor Destroy;
    procedure AddFile;
    procedure AddStream;
    procedure AddString;
    procedure AddDir;
    procedure AddSymbolicLink;
    procedure AddLink;
    procedure AddVolumeHeader;
    procedure Finalize;
    property Permissions: TTarPermissions; {rw}
    property UID: Integer; {rw}
    property GID: Integer; {rw}
    property UserName: AnsiString; {rw}
    property GroupName: AnsiString; {rw}
    property Mode: TTarModes; {rw}
    property Magic: AnsiString; {rw}
  end;

Inheritance

Description

TTarWriter can be used to create .tar archives. It can be created using a filename, in which case the archive will be written to the filename, or it can be created using a stream, in which case the archive will be written to the stream - for instance a compression stream.

Properties

Member Visibility Description
GID public Archive entry group ID.
GroupName public Archive entry group name.
Magic public Archive entry Magic constant.
Mode public Archive entry mode.
Permissions public Archive entry permissions.
UID public Archive entry user ID.
UserName public Archive entry user name.

Methods

Member Visibility Description
AddDir public Add directory to archive.
AddFile public Add a file to the archive.
AddLink public Add hard link to archive.
AddStream public Add stream contents to archive.
AddString public Add string as file data.
AddSymbolicLink public Add a symbolic link to the archive.
AddVolumeHeader public Add volume header entry.
Create public Create a new archive.
Destroy public Close archive and clean up TTarWriter.
Finalize public Finalize the archive.

See also

Name Description
TTarArchive Class to examine and read tar archives.