License: MIT
Code:
https://github.com/Xelitan/libarchive-for-Delphi-Free-Pascal-Lazarus/Usage:
var A: TPacker;
begin
A := TPacker.Create('output.tar.xz', 'tar', 'xz');
A.AddFile('test.txt', 'test1.txt');
A.AddFile('test.txt', 'test2.txt');
A.AddDirectory('testdir');
A.Free;
var A: TUnpacker;
Info: TFileInfo;
F: TFileStream;
Path: String;
begin
A := TUnpacker.Create('archive.7z');
while A.NextInfo(Info) do begin
Path := 'out_dir\' + Info.Path;
ForceDirectories(ExtractFileDir(Path));
if Info.IsDir then continue;
F := TFileStream.Create(Path, fmCreate);
A.ExtractTo(F);
F.Free;
end;
A.Free;
end;
64-bit DLLs can be downloaded from Github. They should also be available on libarchive's official Github (but right now they have a 404 error).