Verify extracted files

Apr 23, 2010 at 12:49 AM

Hi,

First - AMAZING library!!

Second, is there a 'best practice' to validate the extracted file by code?

Im sorry if thsi subject was already discussed, I couldnt find any reference...

Thanks,

Alon

 

Coordinator
Apr 23, 2010 at 11:32 PM

Yes, there's a ZipFile.CheckZip method - try it.

Apr 24, 2010 at 2:26 AM

I'm actually asking about the extracted file - verify if was extracted fully and correctky.

Alon

Coordinator
Apr 24, 2010 at 11:34 AM

The ZIP format has a CRC in it, for each entry, which is checked automatically when you extract an entry.  If the extract succeeds in DotNetZip, then the CRC has been checked and verified for that entry.  If the CRC check fails, DotNetZip throws an exception.

If you need something more than that, then you'll have to implement it yourself - something like a before-and-after MD5 hash, or whatever you like.

Apr 25, 2010 at 4:21 AM

Great, the CRC is good enough for my needs.

Thanks!

Alon