Home > front end >  How to recreate Could not find: zip split file error
How to recreate Could not find: zip split file error

Time:10-15

I have a zip file over 15gb with an error. I need to modify a bash code to handle the error (not to correct it just to "catch it"), the thing is that the size of the file makes me go very slow when I want to test something, I need to recreate the same error but with a file of like 1gb so I can do testing faster, I have tried everything that came to my mind but without success.

This is the error:

    $ zip -T AUDIOS.zip
    Could not find:AUDIOS.z01
    Hit c (change path to where this split file is)
        q (abort archive - quit)
  or ENTER(Try reading this split again)

The error is obvious but I think is the result of a corrupted file because the zip file is not really a multipart zip so I assume there are some errors in the headers of the file or something like that that makes the zip command think that it is a multipart file.

Note:If I use 7z to unzip the file everything goes well, it says that there are error headers but the file uncompress the right way anyways.

I wrote the last two paragraphs just to give some context, what I really need is to recreate the error in a smaller zip file so when I execute zip -T zipfile it returns the same as the big file.

CodePudding user response:

The link posted by @tink does match the error you are seeing. The unknown is whether the corruption in your zip file matches the one in the link. There may be multiple reason that can trigger that error message. Not sure if that is important to you.

If you want to verify that the details in the link match with your zip file get a copy of zipdetails from here and run this

perl zipdetails -v AUDIOS.zip

It will provide a detailed output of the zip file. For this error you need to post the data at the end of the zip file that looks like this. I've highlighted the part in the link that is the cause of the problem.

00BF 0004 50 4B 06 06 ZIP64 END CENTRAL DIR 06064B50
                      RECORD
00C3 0008 2C 00 00 00 Size of record        000000000000002C
          00 00 00 00
00CB 0001 1E          Created Zip Spec      1E '3.0'
00CC 0001 03          Created OS            03 'Unix'
00CD 0001 2D          Extract Zip Spec      2D '4.5'
00CE 0001 00          Extract OS            00 'MS-DOS'
00CF 0004 00 00 00 00 Number of this disk   00000000
00D3 0004 00 00 00 00 Central Dir Disk no   00000000
00D7 0008 01 00 00 00 Entries in this disk  0000000000000001
          00 00 00 00
00DF 0008 01 00 00 00 Total Entries         0000000000000001
          00 00 00 00
00E7 0008 5A 00 00 00 Size of Central Dir   000000000000005A
          00 00 00 00
00EF 0008 65 00 00 00 Offset to Central dir 0000000000000065
          00 00 00 00

00F7 0004 50 4B 06 07 ZIP64 END CENTRAL DIR 07064B50
                      LOCATOR
00FB 0004 00 00 00 00 Central Dir Disk no   00000000
00FF 0008 BF 00 00 00 Offset to Central dir 00000000000000BF
          00 00 00 00
0107 0004 00 00 00 00 Total no of Disks     00000000  <==== This value should be 1

010B 0004 50 4B 05 06 END CENTRAL HEADER    06054B50
010F 0002 00 00       Number of this disk   0000
0111 0002 00 00       Central Dir Disk no   0000
0113 0002 01 00       Entries in this disk  0001
0115 0002 01 00       Total Entries         0001
0117 0004 5A 00 00 00 Size of Central Dir   0000005A
011B 0004 FF FF FF FF Offset to Central Dir FFFFFFFF
011F 0002 00 00       Comment Length        0000

There is a test file zero.zip that I use in the test harness for zipdetails to check this particular error. If this is indeed the same as you corruption you can just use zero.zip for your testing.

  • Related