Recent

Author Topic: Pure Pascal UnRAR port  (Read 633 times)

Tomxe

  • Jr. Member
  • **
  • Posts: 68
Pure Pascal UnRAR port
« on: April 30, 2026, 08:54:38 am »
License: MIT

https://github.com/Xelitan/Delphi-Free-Pascal-port-of-Unrar---RAR-decompressor/

Listing files:
Code: Pascal  [Select][+][-]
  1. uses Unrar;
  2.  
  3. var rar: TRarUnpacker;
  4.     ADate: TDateTime;
  5.     ASize: Int64;
  6.     AName: String;
  7. begin
  8.  
  9.   rar := TRarUnpacker.Create('pass.rar', 'pass');
  10.   if not rar.CheckPassword then begin
  11.     ShowMessage('Incorrect password!');
  12.     rar.Free;
  13.     Exit;
  14.   end;
  15.  
  16.   while rar.NextEntry(AName, ASize, ADate) do begin
  17.     Memo1.Lines.Add(AName);
  18.   end;
  19.  
  20.   rar.Free;  


Extracting:
Code: Pascal  [Select][+][-]
  1. var
  2.   rar : TRarUnpacker;
  3.   ADate: TDateTime;
  4.   ASize: Int64;
  5.   AName: String;
  6.   F    : TFileStream;
  7.   OutDir, FullPath: String;
  8. begin
  9.   OutDir := 'OutputDir\';   // destination directory
  10.  
  11.   rar := TRarUnpacker.Create('pass.rar', '');
  12.   try
  13.     while rar.NextEntry(AName, ASize, ADate) do
  14.     begin
  15.       Memo1.Lines.Add(AName);
  16.  
  17.       FullPath := IncludeTrailingPathDelimiter(OutDir) + AName;
  18.       ForceDirectories(ExtractFileDir(FullPath));
  19.  
  20.       F := TFileStream.Create(FullPath, fmCreate or fmSHareDenyWrite);
  21.       try
  22.         rar.Extract(F);
  23.       finally
  24.         F.Free;
  25.       end;
  26.     end;
  27.   finally
  28.     rar.Free;
  29.   end;

Boleeman

  • Hero Member
  • *****
  • Posts: 1158
Re: Pure Pascal UnRAR port
« Reply #1 on: May 01, 2026, 12:29:37 pm »
Thanks Tomxe for your great  Unrar-Rar compressor code, Zstandard (zstd) compression algorithm, Zpaq and Zstandard compressors.

I love playing around and experimenting with all your codes.

Much Appreciated.

Tomxe

  • Jr. Member
  • **
  • Posts: 68
Re: Pure Pascal UnRAR port
« Reply #2 on: May 02, 2026, 08:30:10 am »
Thank you!
I had a long break from coding in Pascal due to health issues but it's better now and I am finishing what I started. Some new libraries might pop up soon :)

tooknox

  • New Member
  • *
  • Posts: 32
Re: Pure Pascal UnRAR port
« Reply #3 on: May 02, 2026, 11:33:22 am »
Hey this is really awesome  :)

Just a suggestion though, the repo names are too long you can name it "pUnRAR" (no pun intended...short for pascal unrar) similarly for your lz repos. I mean it's up to you if you want :)

AlexTP

  • Hero Member
  • *****
  • Posts: 2709
    • UVviewsoft
Re: Pure Pascal UnRAR port
« Reply #4 on: May 02, 2026, 12:40:49 pm »
'p' stands also for Python, Perl, PowerShell.
Current long names are almost ok.

Tomxe

  • Jr. Member
  • **
  • Posts: 68
Re: Pure Pascal UnRAR port
« Reply #5 on: May 02, 2026, 04:54:01 pm »
The names are long to attract more viewers. Units have rather short names.

tooknox

  • New Member
  • *
  • Posts: 32
Re: Pure Pascal UnRAR port
« Reply #6 on: May 02, 2026, 07:01:58 pm »
The names are long to attract more viewers. Units have rather short names.

Well that makes sense. Either way what's there in name. Once again great work !! :D

 

TinyPortal © 2005-2018