Unzip streams

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Unzip streams

Darius Blaszyk-2
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

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Unzip streams

Luca Olivetti-2
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  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal