Skip to content

TTarArchive

Class to examine and read tar archives.

Declaration

Source position: libtar.pp line 174

type

  TTarArchive = class
  public
    constructor Create(Stream: TStream); overload;
    constructor Create(const Filename: AnsiString; 
                  FileMode: Word=fmOpenRead or fmShareDenyWrite); overload;
    destructor Destroy;
    procedure Reset;
    function FindNext : Boolean;
    procedure ReadFile(Buffer: POINTER); overload;
    procedure ReadFile(Stream: TStream); overload;
    procedure ReadFile(const Filename: AnsiString); overload;
    function ReadFile : RawByteString; overload;
    procedure GetFilePos;
    procedure SetFilePos;
  end;

Description

TTarArchive is the class used to read and examine .tar archives. It can be constructed from a stream or from a filename. Creating an instance will not perform any operation on the stream yet.

Methods

Member Visibility Description
Create public Create a new instance of the archive.
Destroy public Destroy TTarArchive instance.
FindNext public Find next archive entry.
GetFilePos public Return current archive position.
ReadFile public Read a file from the archive.
Reset public Reset archive.
SetFilePos public Set position in archive.

See also

Name Description
TTarWriter Class to write tar archives.
FindNext Find next archive entry.