Please enable JavaScript to view this site.

Codolex

Navigation: Activities > Zipping

Listing zip

Scroll Prev Top Next More

'Listing zip' can be used to list all the files that are present in the zip file.

Uses System.Zip.TZipFile.Read

 

ListZipFile

Activity properties

 

begin

var ListedZip: ICodolexList<string>;

var ZipFile := TZipFile.Create;

try

   ZipFile.Open(ZipFileToUse, zmRead);

   ListedZip := TCodolexList<string>.Create;

   ListedZip.AddRange(ZipFile.FileNames);

finally

   ZipFile.Close;

   ZipFile.Free;

end;

end;

Resulting Code

 

The provided zipfile can be a string with the path, or a variable of the TZipFile type.

 

The result will be a TCodolexList of strings with the relative paths.

If a file (string) or index (Integer) is provided, only the file with the name or location will be listed as string.

 

 

© by GDK Software