ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Archive functions
  • Error codes
  • Special case of the .GZ extension
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Opens an existing archive.
For the archives in "CAB" or "RAR" format, the archive is created if it does not exist.
The archive can be:
  • in WinZip or PKZip format (.ZIP extension).
  • in WINDEV format (.WDZ extension).
  • in Cabinet file format (.CAB extension).
  • in RAR format (.RAR extension).
  • in 7z format (.7z extension).
  • in TAR format (.TAR extension).
  • in TGZ format (.TGZ extension).
  • in TAR.GZ format (.TAR.GZ extension).
  • New in version 2025
    in gzip format (extension ;gz).
  • an executable (.EXE) corresponding to a .WDZ file changed into a self-extracting archive.
New in version 2025
WEBDEV - Server codeWindowsLinux The gzip format (.gz extension) is now supported.
Example
WEBDEV - Server codeAjax
MonArchive is zipArchive
// Ouverture d'une archive
ResOuvreArchive = MonArchive.Open("C:\MesArchives\Archive.zip")

// Affichage du message d'erreur si l'archive n'a pas été ouverte
IF ResOuvreArchive <> 0 THEN
	Error(zipMsgError(ResOuvreArchive))
END
Syntax
<Result> = <Archive>.Open(<Archive path> [, <Opening mode>])
<Result>: Integer
  • 0 if the archive was opened,
  • An error code (value greater than 0) otherwise. For more details on these error codes, see the Remarks.
<Archive>: zipArchive variable
Name of a variable of type zipArchive corresponding to the archive to use.
The archive is created if it does not exist (except for the "CAB" or "RAR" formats).
<Archive path>: Character string
Path and name of archive (up to 260 characters). The archive extension can be specified. If the archive extension is not specified, the default extension is .WDZ.
<Opening mode>: Optional constant (or combination of constants)
Mode for opening the archive:
zipCreateIfNotFoundCreates the archive if it does not exist
(not available for .CAB and .RAR files)
zipHeader64Allows you to create an archive larger than 4 GB on which <zipArchive variable>.ChangePath can be used.
Archive in TAR or TGZ format (TAR.GZ): This constant is not available.
zipReadOpening in read-only
zipWriteOpening in read/write
(not available for .CAB and .RAR files)

The default opening mode is: zipCreationIfNonexistent + zipWrite.
Remarks

Error codes

The following error codes are returned:
  • 1: Path passed as parameter does not exist.
  • 2: Access denied: user does not have sufficient rights.
  • 3: The archive is corrupt.
  • 6: The files in the sub-archives are not in the right order (this is the case when opening a multi-part archive).
The message corresponding to the error code is returned by zipMsgError. Reminder:
  • Linux Only archives in ZIP, gzip, TAR and TGZ (TAR.GZ) formats are available.

Special case of the .GZ extension

'.tar.gz' files generated by GitHub should not be confused with compressed '.gz' files.
Content compressed in gzip format can be decompressed with Uncompress.
Component: wd300zip.dll
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/13/2024

Send a report | Local help