Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2019-03

Unzip streams

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Darius Blaszyk

Hi,

I would like to unzip a file that contains folders and files from a stream. Can this be done with TUnzipper? Anyone has an example?

Rgds, Darius
<#m_6214636624668668523_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Luca Olivetti
to Darius Blaszyk

El 14/3/19 a les 23:23, Darius Blaszyk ha escrit:

Hi, I would like to unzip a file that contains folders and files from a stream. Can this be done with TUnzipper? Anyone has an example?
procedure ZipInstall(const sourcezip, destdir: string;
splashwindow:TSplashWindow);
   var unzipper:TUnZipper;
   begin
     unzipper:=TUnzipper.create;
     unzipper.FileName:=sourcezip;
     unzipper.OutputPath:=destdir;
     unzipper.examine;
     splashwindow.FileCount:=unzipper.Entries.Count;
     ;
     unzipper.UnZipAllFiles;
     unzipper.free;
   end;

(TSplashWindow is a form where I show the progress)

I never tried but if you want to use a stream, instead of setting FileName you can assign OnOpenInputStream and create a stream there.

Bye

Luca