Recent

Author Topic: [Solved} [Abbrevia] Getting the filename of an extracted file  (Read 2888 times)

heebiejeebies

  • Full Member
  • ***
  • Posts: 143
[Solved} [Abbrevia] Getting the filename of an extracted file
« on: December 28, 2024, 03:12:13 am »
How do I get the filename of the file I've just extracted from a .zip using Abbrevia?

There should only ever be one file in the .zip, and it will be password protected, so I believe Abbrevia is my only option.

Thanks for your help.
« Last Edit: December 28, 2024, 12:27:58 pm by heebiejeebies »
Mint 22 Cinnamon / FPC 3.3.1 / L 3.6.0

paweld

  • Hero Member
  • *****
  • Posts: 1357
Re: [Abbrevia] Getting the filename of an extracted file
« Reply #1 on: December 28, 2024, 06:59:25 am »
Code: Pascal  [Select][+][-]
  1. var
  2.   unZip: TAbUnZipper;
  3.   i: Integer;
  4. begin
  5.   unZip := TAbUnZipper.Create(Self);
  6.   unZip.FileName := 'd:\archive.zip';
  7.   unZip.ArchiveType := atZip;
  8.   unZip.ExtractOptions := [eoCreateDirs, eoRestorePath];
  9.   for i := 0 to unZip.Count - 1 do
  10.   begin
  11.     if unZip.Items[i].IsDirectory then
  12.       ShowMessage('Directory: ' + unZip.Items[i].FileName)
  13.     else
  14.       ShowMessage('File: ' + unZip.Items[i].FileName);
  15.   end;
  16.   unZip.Free;        
  17. end;    
Best regards / Pozdrawiam
paweld

heebiejeebies

  • Full Member
  • ***
  • Posts: 143
Re: [Abbrevia] Getting the filename of an extracted file
« Reply #2 on: December 28, 2024, 12:27:32 pm »
Worked, thank you!  :D
Mint 22 Cinnamon / FPC 3.3.1 / L 3.6.0

 

TinyPortal © 2005-2018