PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Use conditions
  • Error codes
  • Archive Destination
  • Deletion of Source Archive
  • Reserved Space
  • Splitting order
  • Number of parts
  • Closing the archive
  • Actions that can be performed on a multi-part archive
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Splits an archive into several sub-archives of a given size.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
WINDEVWEBDEV - Server codeReports and QueriesAjaxUser code (UMC)
ResOpenArchive, ResSplit are int
// Open the archive named "Archive"
ResOpenArchive = zipOpen("Archive", "D:\Backups\Backup.WDZ")

IF ResOpenArchive = 0 THEN
// Split an archive into several sub-archives (1.4 MB each)
ResSplit = zipSplit("Archive", "A:\Archive.WDZ", 1400*1024)
...
END
Windows Mobile
ResOpenArchive, ResSplit are int
// Open the archive named "Archive"
ResOpenArchive = zipOpen("Archive", "\Backups\Backup.zip")
IF ResOpenArchive = 0 THEN
// Split an archive into several sub-archives (1.4 MB each)
ResSplit = zipSplit("Archive", "\Archive.zip", 1400*1024)
...
END
Syntax
<Result> = zipSplit(<Archive> , <Archive Destination> [, <Size of Sub-archives> [, <Deletion of Source Archive> [, <Reserved Space> [, <Management of Progress Bar>]]]])
<Result>: Integer
  • 0 if the archive was split,
  • An error code (value greater than 0) otherwise. See the Notes for more details.
<Archive>: Character string (with quotes) or zipArchive variable
Name of archive to use.
This name can correspond to:
<Archive Destination>: Character string (with quotes)
Full path of new multi-part archive (up to 260 characters). This path must contain the name of the multi-part archive to create. You have the ability to specify the same path and name as the source archive: the source archive will be overwritten by the split archive.
<Size of Sub-archives>: Optional integer
Size (in bytes) of the volumes to create. The default size of sub-archive is equal to 1.4 MB (1400*1024 bytes). The minimum size is equal to 300KB for each sub-archive (300*1024 bytes).
<Deletion of Source Archive>: Optional boolean
  • True if the source archive will be deleted during the split,
  • False (default value) if the source archive will not be deleted during the split.
<Reserved Space>: Optional integer
Size (in bytes) of a reserved space to deduct from the size of first sub-archive. The size of first sub-archive will be: <Size of Sub-archives> - <Reserved Space>.
<Management of Progress Bar>: Optional character string (with or without quotes)
Versions 21 and later
WINDEViPhone/iPadWindows MobileUniversal Windows 10 App Name of Progress Bar control found in a window. The progress bar will display the progress of split.
New in version 21
WINDEViPhone/iPadWindows MobileUniversal Windows 10 App Name of Progress Bar control found in a window. The progress bar will display the progress of split.
WINDEViPhone/iPadWindows MobileUniversal Windows 10 App Name of Progress Bar control found in a window. The progress bar will display the progress of split.
Remarks

Use conditions

An archive can be split if:
  • The archive exists (an archive is created by zipCreate).
  • The archive is accessible in read/write.
  • The archive is a single-part archive.
Caution:
  • Archives in "CAB" format: This function is not available.
  • Archives in "RAR" format: This function is not available.
  • Archives in "7z" format: This function is not available.
  • Archives in "TAR" and "TARGZ" format: This function is not available.
LinuxiPhone/iPadWindows Mobile Reminder: Only the archives in ZIP format are available.
Reminder:
  • LinuxiPhone/iPad Only the archives in ZIP, TAR and TGZ (TAR.GZ) format are available.
  • Windows Mobile Only the archives in ZIP format are available.

Error codes

The following error codes are returned:
  • 1: The path passed in parameter does not exist.
  • 2: Access denied: the user has no sufficient rights.
  • 3: The archive is corrupted.
  • 6: The sub-archives are not arranged in order.
  • 22: Unable to split as archive in zip format into a single part.
The message corresponding to the error code is returned by zipMsgError.

Archive Destination

<Destination> must correspond to a media accessible in read/write. This parameter can be:
  • A hard disk.
  • A floppy drive, a network drive, etc.
  • A network drive to which a drive letter was assigned. No split operation can be performed to a UNC drive.
The destination is a floppy disk: a dialog box automatically asks for the change of diskettes. If the "Cancel" button of this dialog box is used, zipSplit returns the error #3: "The split archive is corrupted (its creation is not completed), the source archive is intact".
Caution: If <Deletion of Source Archive> is set to True, the source archive and the split archive are both corrupted.
Extension of the multi-part archive (WDZ format)Extension of the multi-part archive (ZIP format)
If the extension of the archive is not specified, the default extension of first sub-archive will be .WDZ.
The extension of other sub-archives will be automatically added (".001" to ".999").
For example: If <Destination> = "C:\MyArchives\SplitArchive.WDZ", the archive will be split into the "C:\MyArchives" directory as follows:
  • SplitArchive.WDZ
  • SplitArchive.001
  • SplitArchive.002
  • SplitArchive.003
  • ...
If the archive extension is not specified, the default extension of first sub-archive will be .ZIP.
The extension of other sub-archives will be automatically added (".Z01" to ".Z99").
For example: If <Destination> = "C:\MyArchives\SplitArchive.ZIP", the archive will be split into the "C:\MyArchives" directory as follows:
  • SplitArchive.ZIP
  • SplitArchive.Z01
  • SplitArchive.Z02
  • SplitArchive.Z03
  • ...

Deletion of Source Archive

If <Deletion of Source Archive> is set to True, the source archive is closed and destroyed as the split is performed.
Notes:
  • To reduce the disk space required to perform the split operation, <Deletion of Source Archive> must be set to True. Indeed, to split a large archive, the necessary disk space is twice the archive size: once for the source archive and once for the split archive.
  • This parameter must be used with great care. Indeed, if a problem occurs during the split operation, the source archive and the split archive will both be destroyed. If the disk space is not sufficient, we advise you to split the source archive and to delete this source archive thereafter.

Reserved Space

The size of first sub-archive can be smaller than the size of other sub-archives. To do so, specify how much you want to reduce the size of first sub-archive (in bytes) in <Reserved Space>.
For example, when copying to diskettes, it may be useful if the first sub-archive does not occupy the entire space on the first diskette. This allows you to store the existing files on the first diskette.
The size of first sub-archive will be: <Size of Sub-archives> - <Reserved Space>.
Note: The size of the first sub-archive must comply with the following formula:
<Size of Sub-archives> - <Reserved Space> > 300 KB.
For example, if the size of each sub-archive is 1.4 MB, the size of the reserved space cannot exceed 1.1 MB.

Splitting order

When splitting an archive, the order in which the archive is split is as follows:
  • Creating the sub-archive N (".NNN-1" or ".ZNN-1" extension).
  • ...
  • Creating the sub-archive 2 (".001" or "Z01" extension).
  • Creating the sub-archive 1 (".WDZ" or "ZIP" extension).
For example, if an archive is split into 4 parts, 4 sub-archives will be created. The fourth sub-archive (".003" or "Z03" extension) will be created first. The first sub-archive (".WDZ" or ".ZIP" extension) will be created last.
Splitting an archive on diskettes directly: The first inserted diskette will contain the last sub-archive.

Number of parts

zipNbPartNeeded is used to find out the number of parts required to split the archive.
zipNbPart is used to find out the number of sub-archives in a multi-part archive.
Note: Splitting an archive in ZIP format into a single part is not allowed and it triggers an error.

Closing the archive

Once zipSplit has been used on an archive, this archive is not closed. You must use:
  • zipClose to close the single-part archive.
  • zipOpen to open the new multi-part archive.
Note: If <Deletion of Source Archive> is set to True, the source archive is automatically closed by the split operation.

Actions that can be performed on a multi-part archive

Some archiving functions can only be used on the single-part archives (add and delete files, create a self-extracting executable, ...). To perform these operations, all you have to do is group the sub-archives (zipMerge) to get a single-part archive.
From a multi-part archive, you only have the ability to:
Components
WINDEVWEBDEV - Server codeReports and Queries wd230zip.dll
Windows Mobile wp230zip.dll
Linux wd230zip.so
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment