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.OnStartFile:=@splashwindow.OnStartFile;
    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
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to