[delphizip] Re: Error handling

  • From: "Roger Aelbrecht" <Aelbrecr@xxxxxxxxxx>
  • To: <delphizip@xxxxxxxxxxxxx>
  • Date: Mon, 12 Apr 2004 21:04:40 +0200

Stefan wrote:
> Roger, you with all your experience maybe can give me some hints here.
> I just want to 'catch' files that are not valid zip-files so they
> don't show up in a list and also tell the user which file(s) are not
> valid. I will do that in the OnMessage event handler.
> 
> If I set Unattended = true , how can I  in a smart way deal with other
> errors?
> Can the program at any event hang?
> I do use try - except but can the dll-file cause something I can't
> deal with?
> 
> I see no reason toreplace DelphiZip with Abbrevia. DelphiZip has
> served me well in many applications.
> 
> Keep up the good work.
> 
> - Stefan
> 

Stefan,
You can find a function in ZipMaster called  QueryZip
that function will tell you if a file is a valid zip file or not

function QueryZip(const Fname: string): integer; // new 1.73

If the helpfile does not explain it fully have a look in the
ZipMast.pas file, Russell added a lot of comment how to work
with this file.

You could call the QueryZip before setting the ZipFileName in
ZipMaster, QueryZip has been added for this type of tests
Before the test was based on file extension only.


If you set Unattended to false then your application has to react
on every possible error or you may mis some information.
Noramlly there sould not be any blocking in the code, but there
is no other way of knowing that something went wrong


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

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