mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 06:49:23 +02:00
* fix unzipping of all files
* create outputdirectory if it doesn't exists git-svn-id: trunk@9235 -
This commit is contained in:
parent
ebbb2db336
commit
80008b5146
@ -1232,6 +1232,7 @@ End;
|
|||||||
Function TUnZipper.OpenOutput(OutFileName : String) : Boolean;
|
Function TUnZipper.OpenOutput(OutFileName : String) : Boolean;
|
||||||
|
|
||||||
Begin
|
Begin
|
||||||
|
ForceDirectories(ExtractFilePath(OutFileName));
|
||||||
FOutFile:=TFileStream.Create(OutFileName,fmCreate);
|
FOutFile:=TFileStream.Create(OutFileName,fmCreate);
|
||||||
Result:=True;
|
Result:=True;
|
||||||
If Assigned(FOnStartFile) then
|
If Assigned(FOnStartFile) then
|
||||||
@ -1358,17 +1359,18 @@ Procedure TUnZipper.UnZipAllFiles;
|
|||||||
Var
|
Var
|
||||||
Item : TZipItem;
|
Item : TZipItem;
|
||||||
I : Integer;
|
I : Integer;
|
||||||
|
AllFiles : Boolean;
|
||||||
Begin
|
Begin
|
||||||
FUnZipping:=True;
|
FUnZipping:=True;
|
||||||
Try
|
Try
|
||||||
|
AllFiles:=(FFiles.Count=0);
|
||||||
OpenInput;
|
OpenInput;
|
||||||
Try
|
Try
|
||||||
ReadZipDirectory;
|
ReadZipDirectory;
|
||||||
For I:=0 to FZipEntries.Count-1 do
|
For I:=0 to FZipEntries.Count-1 do
|
||||||
begin
|
begin
|
||||||
Item:=TZipItem(FZipEntries[i]);
|
Item:=TZipItem(FZipEntries[i]);
|
||||||
if (FFiles=nil) or
|
if AllFiles or
|
||||||
(FFiles.IndexOf(Item.Name)<>-1) then
|
(FFiles.IndexOf(Item.Name)<>-1) then
|
||||||
UnZipOneFile(Item);
|
UnZipOneFile(Item);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user