PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Error codes
  • Extracted file
  • Extraction and password
  • Stored path
  • Progress Bar
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
Extracts and decompresses a list of files found in an archive to a physical location.
Versions 15 and later
Android This function is now available for Android applications.
New in version 15
Android This function is now available for Android applications.
Android This function is now available for Android applications.
Versions 17 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Android Widget This function is now available in Android Widget mode.
Versions 19 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 19
Universal Windows 10 App This function is now available in Windows Store apps mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
iPhone/iPadUniversal Windows 10 App This function now supports the TAR and TGZ (TAR.GZ) formats.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
iPhone/iPadUniversal Windows 10 App This function now supports the TAR and TGZ (TAR.GZ) formats.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
iPhone/iPadUniversal Windows 10 App This function now supports the TAR and TGZ (TAR.GZ) formats.
Example
Windows Mobile
// Open an archive
ResOpenArchive = zipOpen("Archive", "\Archives\Archive.zip")
IF ResOpenArchive = 0 THEN
...
// Extract a file to its initial location
ResExtractFile = zipExtractFile("Archive", "File.txt" + CR + "File2.txt", ...
zipDrive)
...
END
 
Windows Mobile
Archive is zipArchive
// Open an archive
ResOpenArchive = zipOpen(Archive, "\Archives\Archive.zip")
IF ResOpenArchive = 0 THEN
...
// Extract a file to its initial location
ResExtractFile = zipExtractFile(Archive, "File.txt" + CR + "File2.txt", ...
zipDrive)
...
END
 
Syntax
<Result> = zipExtractFileList(<Archive> , <List of paths> [, <Destination> [, <Options> [, <WLanguage procedure> [, <Progress bar management>]]]])
<Result>: Integer
  • 0 if the files have been extracted,
  • An error code (value greater than 0) otherwise. For more details on these error codes, see the Remarks.
<Archive>: Character string (with quotes) or zipArchive variable
Name of archive to use.
This name can correspond to:
<List of paths>: Character string (with quotes)
List of stored paths of files that will be extracted from the archive. The different paths are separated by CR characters (Carriage Return).
Performs an exact-match search on each path of files found in the archive.
<Destination>: Optional character string or constant
Destination path of extracted files:
  • Optional character string: The files are extracted into the specified path to which is added the tree structure of the file (the disk is not stored). The specified path is created if it does not exist.
    Universal Windows 10 App The destination path of the extracted file must correspond to the working directory of the application (returned by fDataDir) or one of its subdirectories.
  • Optional constant:
    zipNoneExtraction into the current directory without restoring the tree structure of the files (if it was stored).
    zipDriveExtraction:
    • to the initial location of the files if it was stored and if the drive exists.
    • while restoring the tree structure of the files on the current drive if the drive or the stored directory does not exist.
    • in the current directory if only the name and extension of the files have been stored.
    iPhone/iPad This constant is not available. The directories have no root.
    AndroidAndroid Widget This constant and zipDirectory will have the same effect. Archives in 7z format: This constant and zipDirectory will have the same effect.
    zipDirectory
    (Default value)
    Extraction into the current directory without restoring the tree structure of the files (if it was stored).
Windows Mobile These constants cannot be used because the notion of current directory is not supported by the Pocket PC.
Universal Windows 10 App These constants cannot be used.
<Options>: Optional constant
Configure the extraction (if <Destinations> corresponds to a character string):
zipOverwriteDuring the extraction, the existing read-only files are automatically overwritten by the extracted files.
AndroidAndroid Widget This constant is not available.
<WLanguage procedure>: Optional character string
Versions 19 and later
Name of the WLanguage procedure that will be called if an error occurs when extracting files. This procedure has the following format:
PROCEDURE ProcedureName (<Error Code>, <File Name>)
where:
  • <Error code> is an integer corresponding to the code of the error that occurred when extracting the file.
  • <File name> is a character string that contains the path of the file processed by zipExtractFileList.
The procedure can return one of the following constants:
zipCancelCancels the extraction of files from the archive.
zipIgnoreIgnores the file in error.
zipRetryRetries the file extraction.
AndroidAndroid Widget This parameter is not allowed.
New in version 19
Name of the WLanguage procedure that will be called if an error occurs when extracting files. This procedure has the following format:
PROCEDURE ProcedureName (<Error Code>, <File Name>)
where:
  • <Error code> is an integer corresponding to the code of the error that occurred when extracting the file.
  • <File name> is a character string that contains the path of the file processed by zipExtractFileList.
The procedure can return one of the following constants:
zipCancelCancels the extraction of files from the archive.
zipIgnoreIgnores the file in error.
zipRetryRetries the file extraction.
AndroidAndroid Widget This parameter is not allowed.
Name of the WLanguage procedure that will be called if an error occurs when extracting files. This procedure has the following format:
PROCEDURE ProcedureName (<Error Code>, <File Name>)
where:
  • <Error code> is an integer corresponding to the code of the error that occurred when extracting the file.
  • <File name> is a character string that contains the path of the file processed by zipExtractFileList.
The procedure can return one of the following constants:
zipCancelCancels the extraction of files from the archive.
zipIgnoreIgnores the file in error.
zipRetryRetries the file extraction.
AndroidAndroid Widget This parameter is not allowed.
<Progress bar management>: Optional character string (with or without quotes)
Versions 21 and later
Mode for managing the progress bar. This parameter can correspond to:
  • iPhone/iPadWindows MobileUniversal Windows 10 App the name of a Progress Bar control found in a window. The progress bar will display the progress regarding the extraction of all the files used.
  • the name of a WLanguage procedure. This procedure has the following format:
    <Procedure name> (<Current file>, <Global progress percentage>,
    <File progress percentage >)

    where:
    • <Current file> corresponds to the name of the file currently processed.
    • <Global progress percentage> corresponds to the progress percentage of the extraction of files from the archive.
    • <File progress percentage> corresponds to the progress percentage of the file being extracted from the archive.
If you are using an archive:
  • in TAR or TGZ (TAR.GZ) format, the progress bar is refreshed at the end of the extraction of each file.
  • in CAB and RAR format, the progress bar is refreshed at the end of the extraction of each file.
  • in 7z format, only <Global progress percentage> is specified. <File progress percentage> will have the same value.
New in version 21
Mode for managing the progress bar. This parameter can correspond to:
  • iPhone/iPadWindows MobileUniversal Windows 10 App the name of a Progress Bar control found in a window. The progress bar will display the progress regarding the extraction of all the files used.
  • the name of a WLanguage procedure. This procedure has the following format:
    <Procedure name> (<Current file>, <Global progress percentage>,
    <File progress percentage >)

    where:
    • <Current file> corresponds to the name of the file currently processed.
    • <Global progress percentage> corresponds to the progress percentage of the extraction of files from the archive.
    • <File progress percentage> corresponds to the progress percentage of the file being extracted from the archive.
If you are using an archive:
  • in TAR or TGZ (TAR.GZ) format, the progress bar is refreshed at the end of the extraction of each file.
  • in CAB and RAR format, the progress bar is refreshed at the end of the extraction of each file.
  • in 7z format, only <Global progress percentage> is specified. <File progress percentage> will have the same value.
Mode for managing the progress bar. This parameter can correspond to:
  • iPhone/iPadWindows MobileUniversal Windows 10 App the name of a Progress Bar control found in a window. The progress bar will display the progress regarding the extraction of all the files used.
  • the name of a WLanguage procedure. This procedure has the following format:
    <Procedure name> (<Current file>, <Global progress percentage>,
    <File progress percentage >)

    where:
    • <Current file> corresponds to the name of the file currently processed.
    • <Global progress percentage> corresponds to the progress percentage of the extraction of files from the archive.
    • <File progress percentage> corresponds to the progress percentage of the file being extracted from the archive.
If you are using an archive:
  • in TAR or TGZ (TAR.GZ) format, the progress bar is refreshed at the end of the extraction of each file.
  • in CAB and RAR format, the progress bar is refreshed at the end of the extraction of each file.
  • in 7z format, only <Global progress percentage> is specified. <File progress percentage> will have the same value.
Remarks

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.
  • 4: The path does not exist in the archive.
  • 6: The files of the sub-archives are not arranged in order (when extracting from a multi-part archive).
  • 21: The specified password is not correct.
The message corresponding to the error code is returned by zipMsgError.
Remarks:
  • iPhone/iPadUniversal Windows 10 App Only the archives in ZIP, TAR and TGZ (TAR.GZ) format are available.
  • AndroidAndroid Widget Windows Mobile Only the archives in ZIP format are available.

Extracted file

The extracted files are not deleted from the archive. To delete one file or all the files from the archive, use zipDeleteFile or zipDeleteAll.
iPhone/iPadWindows MobileUniversal Windows 10 App

Extraction and password

If the file is not encrypted and if zipPassword was used:
  • Archive in WDZ format: The file is still extracted.
  • Archive in ZIP format: An error occurs.

Stored path

The table below presents the paths stored in the archive according to:
  • the access path to the file,
  • the stored path section.
The current directory is: "C:\Temp".
zipAddFileFile locationzipNonezipDirectoryzipDrive
zipAddFile("Archi",
"File.txt")
C:\Temp\File.txtFile.txtFile.txtFile.txt
zipAddFile("Archi",
"Data\File.txt")
C:\Temp\Data\File.txtFile.txtData\File.txtData\File.txt
zipAddFile("Archi",
"D:\Data\File.txt")
D:\Data\File.txtFile.txtData\File.txtD:\Data\File.txt


Remark: If the zipDrive constant is used:
  • the WDZ format stores the full path of the file (including the drive letter).
  • the ZIP format does not store the drive letter.
  • the 7z format stores the directories only.
AndroidAndroid Widget The zipDrive constant is equivalent to the zipDirectory constant.
Universal Windows 10 App The directory and the disk are not stored in the archive path. Only the file name and extension are stored.
Windows Mobile The table below presents the paths stored in the archive according to:
  • the access path to the file,
  • the stored path section.
zipAddFileFile locationzipNonezipDirectory
zipAddFile("Archi",
"\File.txt")
\File.txtFile.txtFile.txt
zipAddFile("Archi",
"\Temp\File.txt")
\Temp\File.txtFile.txtTemp\File.txt
Windows Mobile

Progress Bar

In Windows, to view the progress of file extraction and decompression, an event must be branched on CompressGauge (1174). When this message is received, the _EVE.wParam variable contains the percentage of file already decompressed.
Versions 21 and later
From version 21, <Progress bar management> can also be used to manage the file addition progress.
New in version 21
From version 21, <Progress bar management> can also be used to manage the file addition progress.
From version 21, <Progress bar management> can also be used to manage the file addition progress.
Component : wd240zip.dll
Minimum version required
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment