[delphizip] Re: OnSetExtraField

  • From: Gerard <gslurink@xxxxxx>
  • To: delphizip@xxxxxxxxxxxxx
  • Date: Thu, 21 Nov 2002 15:58:06 +0200

Hi Rusell,

I am not sure what 'format it' exactly means but I guess it would be good 
idea to prevent that an event handler (user) can screw up the file, so that 
for example the eventhandler can write an array of byte or a string in the 
payload of the extra field and the rest is handled behind the scene. If I 
would ever use this field for a rename as I once proposed, I would write 
special procedure for this, which handles name and extra field and their 
sizes at the same time.

Same prevention with the OnNewName event: do not allow writing names that 
cannot be parsed (like \folder\file.pas )

I once read from some Delphi pro, and I find this a very good principle: it 
should be possible to set a property of a component to any value that it 
accepts, without giving trouble. There should be no hidden rules or 
required order. I know this it not so easy as it sound though ;-)

Cheers,
Gerard.

At 07:46 21.11.2002 +1100, you wrote:
>When implementing handling to set the 'extra field' do I format it (as per 
>recomendations) or do I leave it up to the person using it to format the data?
>It is essential that the extra field data be correctly formatted and 
>identified or the zipfile cannot be opened (reliably) by other programs.
>
>Russell Peters
>http://www.users.bigpond.com/russellpeters/delphizip.html


Other related posts: