PDA

View Full Version : Handling of corrupted .zip files


16-Nov-2004, 08:23 AM
Using B.C. 227, I just downloaded the file

ftp://FTP.ANTIVIRUS.COM/products/interscan/imss55-win-b1107.zip

The file is corrupted on the server, I downloaded it with other tools and got the same result, so the problem is not with B.C. 227. The problem is that when I use B.C. 227 to compare this file with another one with the same name that I downloaded days ago, it does not say anything about the file being corrupted, even if the first part of the file is full of binary zero. Only when I try to open another .zip file that is inside it, imss55-win-b1107.zip\IMSS55\IMSS55_ENU_GM\IMSS55Agent_1107.zi p, it says it is corrupted. So, it might be a good idea to improve the detection and the handling of wrong .zip files. It is possible the the file will be immediately replaced on the server, but I have kept a copy of this file and a copy of the previous version (that was ok). So, if You want, I can upload this file to Your ftp.
Thank You
Rodolfo Giovanninetti

Chris
16-Nov-2004, 09:15 AM
The handling of invalid zips depends on your BC settings.

With the default settings, BC does not expand zip files until you double click on them, so it won't be able to tell if they are valid.

If you check "Always treat archive files as folders" in the Advanced tab of Session|Comparison Control, and you have "Automatically scan subfolders in background" turned on in the General tab of Session|Comparison Control, BC will try to compare the contents of zips, and it will give you errors (in the log) for invalid archives like:

11/16/2004 10:11:38 AM IMSS55/IMSS55_ENU_GM/RInstall/tmi/_sys1.cab does not appear to be a valid cabinet archive
11/16/2004 10:11:38 AM IMSS55/IMSS55_ENU_GM/RInstall/tmi/_user1.cab does not appear to be a valid cabinet archive
11/16/2004 10:11:38 AM IMSS55/IMSS55_ENU_GM/RInstall/tmi/data1.cab does not appear to be a valid cabinet archive
11/16/2004 10:11:39 AM IMSS55/IMSS55_ENU_GM/_sys1.cab does not appear to be a valid cabinet archive
11/16/2004 10:11:39 AM IMSS55/IMSS55_ENU_GM/_user1.cab does not appear to be a valid cabinet archive
11/16/2004 10:11:39 AM IMSS55/IMSS55_ENU_GM/data1.cab does not appear to be a valid cabinet archive
11/16/2004 10:11:39 AM IMSS55/IMSS55_ENU_GM/IMSS55Agent_1107.zip does not appear to be a valid zip archive

When you compare the invalid zip file.

16-Nov-2004, 10:27 AM
Sorry, I forgot to specify that I had opened the file with a double click. After Your message, I tried different combinations of the setting "Always treat archive files as folders" and "Automatically scan subfolders in background", but the problem is the same. B.C. 227 displays errors for some files that are inside the main .zip file: some .cab files, that must be in a formt that is different from the MS one; and a second .zip, that I described in my previous message. As I said, the problem with B.C. 227, in my opinion, is not that it corrupts the file, but that it does not understand immediately the file is corrupted.
Thank You again
Rodolfo Giovanninetti

Chris
16-Nov-2004, 12:09 PM
I'm not sure if the main .zip is corrupted. I was able to open the readme.txt in the file, but not any of the archives within the main .zip file.

16-Nov-2004, 02:20 PM
If You look at the file with list or with a hexadecimal viewer, can You confirm that the first part is full of 0?
When You say that You were not able to open any of the archives within the main .zip file, do You mean that You were not able to open .cab files? This might be ok, there are .cab files that are not in the standard microsoft format, so it is normal that B.C. 227 cannot open them. This is one of the features that I asked for in a previous wish list. What is strange is that it is not possible to open the .zip file that is inside. And also it is strange that, even if the first part of the file is full of 0, it is considered as a normal .zip archive not only by B.C. 227, but also by other software, that can extract some files.
Thank You
Rodolfo Giovanninetti

Chris
16-Nov-2004, 02:48 PM
I checked it and the beginning of the file is all zeros.

ZIP files store the directory listing at the end of the file, so as long as the listing is valid, BC won't be able to tell that a file within the zip is invalid.

The only way to determine the contents of the files are invalid is to extract them and check their CRCs, so BC won't detect the files are invalid until you expand them.