[delphizip] OnSetNewName

  • From: Gerard <gslurink@xxxxxx>
  • To: delphizip@xxxxxxxxxxxxx
  • Date: Mon, 04 Nov 2002 20:14:10 +0200

Roger, Eric, Russell, Paul and others,

I asked some mails ago how to rename before adding a file and Roger 
mentioned the OnSetNewName.
I first though the event happened when renaming the archive :^), but I 
decided to check and Roger is correct, you can give here a file that is 
added a different path/name then it would have by default. Very usefull for 
adding copies.
This solves already a part of my problems. :-)

Paul, you can use this event to rename a copy of a file in use. Beware to 
pass a correct path/name because it accepts virtually anything, which 
cannot be deleted anymore affterwards.

Eric and Rusell,
independent of further developments of a new format, I have to finish my 
current project.
Would it be possible to add to the callback from the dll an actioncode 14, 
in which case the extra field is passed via ZCallBackStruct.FileNameOrMsg 
and add an OnSetExtraField event.
Everything similar as now happens with the filename

In function ZCallback this would be something like
case Actioncode of
14:  if Assigned(FOnSetExtraField) then
       begin
           OldExtraField := Msg;
           IsChanged := False;

           FOnSetExtraField(Caller, OldExtraField , IsChanged);
           if IsChanged then
           begin
              StrPLCopy(FileNameOrMsg, OldExtraField , 512);
              ErrorCode := 1;
           end
           else
               ErrorCode := 0;
        end;

It would also be nice if the ZCallBackStruct would pass the actual length 
(back and forward) of the actual length in FileNameOrMsg, but I'm not sure 
if that is that simple.

Regards,
Gerard.


Other related posts: