Xceed Zip Compression Library Documentation
SpanMultipleDisks property
Xceed Zip control reference > Xceed Zip control properties > SpanMultipleDisks property

Description

The SpanMultipleDisks property allows you to control whether spanned zip files should be created if the drive or disk where the zip file is being written gets full. This property applies only when using the Zip method.

Data type

xcdDiskSpanning

Possible values

Enum Value Meaning
xdsNever 0 If the drive or disk where the zip file is being written gets full, zipping will be aborted and the xerWriteZipFile error will be returned.
xdsAlways

1

If the drive or disk where the zip file is being written gets full, the InsertDisk event will be triggered, allowing your application to perform various actions, including the possibility to query for a new disk to be inserted.
xdsRemovableDrivesOnly

2

If the drive or disk where the zip file is being written is considered to be a removable media device by Windows, the InsertDisk event will be triggered when the drive gets full. If it is not considered to be a removable media device by Windows, then zipping will be aborted and the xerWriteZipFile error will be returned. Note: CD-ROMs, floppy disks, Superdisks ™, Zip™ and Jazz™ drives are all considered removable media devices, but not when they are accessed through a network. If you are using one of these devices through a network, use the xdsAlways setting instead of the xdsRemovableDrivesOnly setting.

Default value

xdsRemovableDrivesOnly

Declaration (DLL API)  

UINT XzGetSpanMultipleDisks( HXCEEDZIP hZip )

void XzSetSpanMultipleDisks( HXCEEDZIP hZip, UINT uValue )

Remarks

When SpanMultipleDisks is set to xdsAlways or xdsRemovableDrivesOnly and that a removable drive is being written to, you can only use the Zip method to create a new spanned zip file. Once the spanned zip file has been created and contains files, no more files can be added to, or replaced in it.

When creating spanned zip files, the zip format dictates that the directory of files contained in the zip file is located on the last disk of the disk set. That is why the last disk must always be inserted before the zip file can be unzipped, listed or verified with the Unzip, ListZipContents or TestZipFile methods. If the last disk is not present in the drive when trying to process a spanned zip file, the InsertDisk event will be triggered so your application can query for the last disk to be inserted. In some cases, such as when there are very many files in the spanned zip file, the directory may be both on the last disk, and the next-to-last disk. Xceed Zip will automatically trigger the InsertDisk twice, once for each disk.

When creating spanned files on devices considered to be removable media by Windows, the volume label of the media is changed to indicate the number of the diskette in the zip file set.

Setting the UseTempFile property to True will allow spanned zip files to be created more efficiently when writing to slow removable media – its use is recommended.

It is a good idea to inform users of your application to label diskettes when creating spanned zip files. A good time to do this is when the InsertDisk event is triggered and your application displays a dialog box requesting the next disk.

Applicable methods

Zip

Related topics

The SplitSize and SplitSize64 properties let you create spanned zip files that are located in the same place, as opposed to creating spanned zip files located on different disks. It also lets you limit the amount of data written to each disk, if you don't necessarily want to completely fill up each disk.