[delphizip] Re: CopyZippedFiles

  • From: Alistair George <bigal@xxxxxxxxxx>
  • To: "Schützmann, Peter" <delphizip@xxxxxxxxxxxxx>
  • Date: Tue, 26 Nov 2002 08:24:40 +1300

Hello Peter,
Where is the call zipmaster.add?
regards,
Alistair+


Tuesday, November 26, 2002, 5:35:00 AM, you wrote:

SP> Hallo Everyone,
SP> I have a small problem with the function "CopyZippedFiles". I want to
SP> transfer the whole
SP> content of a Zipfile(Source) to an other Zipfile(Destination). The =
SP> function
SP> (see below)
SP> works without any problems. But after that i want to delete the =
SP> sourcefile
SP> with the result
SP> that i got an error: Can't delete file, because an other process had =
SP> opend
SP> the file.
SP> It seems to me that the function "CopyZippedFiles" forgot to
SP> close(Fileclose) the sourcefile.
SP> Does anyone had this problem? I would appreciate any help.

SP> Thank You
SP> Peter Sch=FCtzmann


SP> Here you can see my Function: =20

SP> //**********************************************************************=
SP> ****
SP> *********************

SP> function TForm1.zipfilecopy(zipfile1,zipfile2:string):boolean;

SP> var  Katalog    : TStringList;
SP>      i          : integer;

SP> begin
SP>   result:=3Dfalse;

SP>   ZipMaster.ZipFileName:=3Dzipfile1;
SP>   ZipMaster.TempDir:=3DGetTempDir;
SP>   ZipMaster.ExtrOptions:=3DZipMaster.ExtrOptions+[ExtrDirNames];
SP>   ZipMaster.list;

SP>   if ZipMaster.Count>1 then begin
SP>      Katalog:=3DTStringList.Create;
SP>      for i:=3D0 to ZipMaster.Count-1 do begin
SP>          katalog.Add(ZipDirEntry(ZipMaster.ZipContents[i]^).FileName);
SP>      end;
SP>   end
SP>   else begin
SP>      exit;
SP>   end;

SP>   if katalog.count>1 then
SP>      ZipMaster.FSpecArgs.Clear;
SP>      ZipMaster.FSpecArgs.AddStrings(katalog);

SP>      ZipMaster1.ZipFileName :=3Dzipfile2;
SP>      Zipmaster1.TempDir:=3DGetTempDir;
SP>      Zipmaster1.FSpecArgs.Clear;

SP>   if ZipMaster.CopyZippedFiles(ZipMaster1, false, OvrAlways)<>0 then =
SP> begin
SP>      Showmessage('Error');
SP>   end
SP>   else begin
SP>      result:=3Dtrue;
SP>   end;

SP>   result:=3Dtrue;
SP>   katalog.free;
SP> end;
SP> //**********************************************************************=
SP> ****
SP> *********************



-- 
Regards,
 Alistair+


Other related posts: