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

  • From: "Kiri Levente" <kirilevente@xxxxxxxxxx>
  • To: <delphizip@xxxxxxxxxxxxx>
  • Date: Fri, 14 Jan 2005 22:42:17 +0200

The idea is to use this event (or any ZipMaster event) to set the path and 
name of the files in the zip archive. I mean in my project the zipped files 
have completelly different path than the original disk paths, so i need a 
possibility to rename the files or even disable some of them.
I found this event usefull because i have the ExtName parameter. In my case 
the option AddDirNames is not important at all because I simply ignore the 
FileName parameter and I rename the file.
I've used ZipMaster 1.78

1. My First Solution: I've tried without AddDirnames. This is working 
because anyway i set the path, using the information from ExtName. It is 
also possible to set nothing to filename and the file is not added at all. 
Maybe it's a bug (very usefull in my case).

What I found not very logic : i cannot add files with the same filename, 
even if i rename them.
Probably you check the Filenames, why you don't check the renamed files to 
see if you have duplicate filenames ?

Ex:

 C:\My Files\duplicate.txt                         -> 
MyStorageFolder\duplicate.txt
 C:\My Files\Folder\duplicate.txt              -> 
MyStorageFolder2\duplicate.txt
 C:\My Files\Folder\todelete.txt               -> (nothing)

-empty allowed
-duplicate is not possible, because of duplicate filename.

2. My Second Solution: with AddDirnames

Ex.

 C:\My Files\duplicate.txt                         -> 
MyStorageFolder\duplicate.txt
 C:\My Files\Folder\duplicate.txt              -> 
MyStorageFolder2\duplicate.txt
 C:\My Files\Folder\todelete.txt                -> (nothing)

- empty not allowed (Bad Zip Options)
-duplicate is possible

-------------

Question: is there any possibilty to solve this problem ? An event to rename 
the files and to cancel some.

KL


----- Original Message ----- 
From: "Roger Aelbrecht" <Aelbrecr@xxxxxxxxxx>
To: <delphizip@xxxxxxxxxxxxx>
Sent: Friday, January 14, 2005 8:11 PM
Subject: [delphizip] Re: OnSetAddName - remove file from the list


> 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.
> 

-----------
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: