[delphizip] Re: OnSetAddName - remove file from the list

  • From: "Roger Aelbrecht" <Aelbrecr@xxxxxxxxxx>
  • To: <delphizip@xxxxxxxxxxxxx>
  • Date: Fri, 14 Jan 2005 19:11:04 +0100

Kiri Levente wrote:
> HI!
>
> How is possible to cancel, remove the file in this event ?
>
> procedure TBackupThread.ZipMasterOnSetAddName(Sender: TObject; var
> FileName: String; const ExtName: String; var IsChanged: Boolean);
>
> 1. If I NOT set AddDirnames, it is possible to set IsChanged to true,
> and FileName to nothing, it works
>
> Problem with this solution: I cannot add files with the same name
> even if they are in different folders, and I rename them (by adding
> path too), (Bad Zip Options specified)
>
> 2. If I use AddDirnames, then I cannot set nothing, empty string for
> FileName (Bad Zip Options specified).
>
>
> The main question is: how can I cancel a file in this event ?
>
> The second question is : why I cannot set empty string if AddDirnames
> is set, or why without AddDirnames ZipMaster says duplicate filename
> even after renaming the file ?
>
> Thanks.
>
> -----------
> To unsubscribe from this list, send an empty e-mail
> message to:
>   delphizip-request@xxxxxxxxxxxxx
> and put the word unsubscribe in the subject.

You cannot cancel a file in this event, it is only intended to change the 
file
name during the Add operation/
If you set IsChanged to true and nothing to filename you are adding a file 
with an empty filename(noname) to the archive. In future version we intend 
to test legality of the filename and this would surely be illegal.

IF you have AddDirNames not specified then the path is stripped of
and you cannot add the same file twice.
Because the path is stripped off it does not matter that they are in 
different directories, the directory name is removed.

I would have to go into the dll to see why you cannot specify an empty file
with AddDirNames set. I expect a dir name is needed in this case.
The duplicate filename question I explained above



-- 
Roger Aelbrecht
http://home.tiscali.be/driehoeksw



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.11 - Release Date: 12/01/2005

-----------
To unsubscribe from this list, send an empty e-mail 
message to:
  delphizip-request@xxxxxxxxxxxxx 
and put the word unsubscribe in the subject.

Other related posts: