Microsoft KB Archive/836160

= The CAB File Extraction Tool may enter an infinite loop when you try to extract a file that is larger than 2 GB =

Article ID: 836160

Article Last Modified on 3/17/2004

-

APPLIES TO


 * Cabinet Software Development Kit (CAB SDK)

-





SYMPTOMS
When you use the CAB File Extraction Tool (Extract.exe) of the Microsoft Cabinet Software Development Kit (CAB SDK) to try to extract a file that is larger than 2 gigabytes (GB) from a CAB file, the CAB File Extraction Tool may enter an infinite loop.



CAUSE
CAB files have an internal limit on the size of included files. This internal limit is approximately 2 GB. However, the CAB SDK does not enforce this internal limit. Therefore, you can use the CAB SDK to create a CAB file that contains a file that is larger than 2 GB.

This behavior occurs when you try to extract a file that is larger than 2 GB from a CAB file because the CAB File Extraction Tool cannot extract a file that is larger than the 2 GB internal limit.



WORKAROUND
To work around this behavior, split the file that is larger than 2 GB into smaller files, and then include these files in a multi-CAB set. To do this by using the CAB SDK, follow these steps:   Create a directive file (.ddf) in the folder that contains the file that is larger than 2 GB. To do this, use a text editor such as Notepad to create a text file that is named MyDirectiveFile.ddf that contains the following text: .Set CabinetNameTemplate=Test*.cab ; Test1.cab, Test2.cab, and so on. .Set MaxDiskSize=1.44M .Set Cabinet=on .Set Compress=on C:\Test\Test.txt ; The path of the file that is larger than 2 GB .Set DestinationDir=C:\Test  Add the folder that contains the CAB File Extraction Tool and the Advanced CAB File Creation Tool (Makecab.exe) to the path environment variable. To do this, run the following command at a command prompt:

set path=%path%;

Note  is a placeholder for the path of the folder that contains the Extract.exe file and the Makecab.exe file. At a command prompt, switch to the folder that contains the Test.txt file. Use the Advanced CAB File Creation Tool to create a multi-CAB set for the Test1.txt file. To do this, run the following command at a command prompt:

Makecab /F MyDirectiveFile.ddf

Folders that are named disk1, disk2, and so on are created in your current folder. Each folder contains a CAB file. Use the CAB File Extraction Tool to extract the Test.txt file. To do this, run the following command at the command prompt:

Extract /A disk1\Test1.cab /L Test1 Test.txt

After some time, you receive the following message in the command prompt window:

Extracting Test1\Test.txt

Extract needs cabinet file 'Test2.cab' from 'Disk 2'.

Please enter the path where this file may be

found, and press ENTER:

 Type the path of the disk2 folder, and then press ENTER. After some time, you receive a message that is similar to the message that you received in step 5.

This new message prompts you to provide the path of the next CAB file that is part of the multi-CAB set.</li> Type the path of the next CAB file in the multi-CAB set, and then press ENTER.

After some time, you receive a message that is similar to the message that you received in step 6.</li> Repeat step 7 until you have extracted all the CAB files in the multi-CAB set.</li></ol>

<div class="status_section">

STATUS
This behavior is by design.

<div class="moreinformation_section">

Steps to reproduce the behavior
<ol> Create a folder in the root folder of drive C on your computer. Name the folder Test.</li> In the Test folder, create a text file that is larger than 2 GB. Name the file Test.txt.</li> Use the Advanced CAB File Creation Tool to create a CAB file for the Test.txt file. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> At a command prompt, switch to the C:\Test folder.</li> Run the following command to create a CAB file for the Test.txt file:

Makecab Test.txt TestCAB.cab

</li></ol> </li> Use the CAB File Extraction Tool to try to extract the Test.txt file from the TestCAB.cab CAB file. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> At a command prompt, run the following command:

Extract TestCAB.cab Test.txt

You receive the following message in the command prompt window:

Extracting Test.txt -> Test.txt

Extract needs cabinet file  from .

Please enter the path where this file may be

found, and press ENTER:

</li> Type the path of the folder that contains the TestCAB.cab CAB file, and then press ENTER. You receive the following message:

ERROR: Could not find cabinet file C:\Test

Extract needs cabinet file  from .

Please enter the path where this file may be

found, and press ENTER:

If you provide the path again, you receive this message again. This behavior is an infinite loop.</li></ol> </li></ol>

<div class="references_section">