Here's my little library to unpack various files in pure Pascal.
Supported:
- ZIP (store & deflate)
- TAR
- RAR (store)
- RAR 5(store)
Does not support encryption.
It's a really simple library right now. You won't create a competitor to WinZIP or WinRAR with it but you can use it to:
- unpack TAR files (should unpack all TAR files)
- unpack most popular ZIP files and files based on ZIP (ODT, DOCX, JAR)
It can work fully on streams - can read archive from a stream and can extract all files to streams.
All input is welcome. If you find it has any value I will add more formats, subformats and features.
Usage example:
uses PV_Unpacker;
var i: Integer;
begin
if not OpenDialog1.Execute then Exit;
Unp := TUnpacker.Create(OpenDialog1.Filename); //or open from TStream
if Unp.GetFormat = '' then ShowMessage('Unsupported'); //or:
if Unp.Count < 0 then ShowMessage('Unsupported');
for i:=0 to Unp.Count-1 do begin
Memo1.Lines.Add( Unp.GetName(i) );
end;
if Unp.CanUnpack(0) then Unp.Extract(0, 'output.jpg'); //or extract to TStream
Unp.Free;