ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Archive functions
  • Use conditions
  • Error codes
  • Stored path of archive files
  • Zip files exceeding 4 GB
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Modifies the stored path of a file in an archive (in ZIP, WDZ or 7z format). Used to configure the extraction path of file.
Example
WINDEVWEBDEV - Server codeUser code (UMC)Ajax
MyArchive is zipArchive
// Open an archive
ResOpenArchive = MyArchive.Open("C:\MyArchives\Archive.zip")
IF ResOpenArchive = 0 THEN
...
// Modify the stored path of File.doc
ResChangePath = MyArchive.ChangePath("File.doc", "Backup.doc")
...
END
Syntax

Modifying the stored path of a file identified by its path Hide the details

<Result> = <Archive>.ChangePath(<File path> , <New file path>)
<Result>: Integer
  • 0 if the modification was performed,
  • 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 in which the path of the file is to be modified.
<File path>: Character string
Stored path of the file to modify.
<New file path>: Character string
New path to store for the file (up to 260 characters).
Remarks

Use conditions

The path of an archive file can be modified if:
  • The archive exists (archives are created using <zipArchive variable>.Create).
  • The archive is accessible in read/write.
  • The archive is a single-part archive.
Caution:
  • Archives in CAB format: This function is not available. This format cannot be used to store the path of a file.
  • Archives in RAR format: This function is not available.
  • Archives in TAR and TGZ (TAR.GZ) format: This function is not available.
  • Archives in 7z format: The archive is entirely compressed whenever <zipArchive variable>.ChangePath is called.
  • LinuxiPhone/iPadIOS WidgetMac Catalyst Only ZIP, TAR and TGZ (TAR.GZ) archives are available.
  • AndroidAndroid Widget Only ZIP archives are available.

Error codes

The following error codes are returned:
  • 1: The path passed as parameter does not exist.
  • 3: The archive is corrupted.
The message corresponding to the error code is returned by zipMsgError.

Stored path of archive files

When adding a file into an archive (<zipArchive variable>.AddFile and <zipArchive variable>.AddDirectory), the section of file path that must be stored in the archive is specified.
The modified path does not necessarily contain the same sections as the initial path. For example, if the paths of the files contain the different directories as well as the name and extension of the file, the new path may only contain the name and extension of the file.

Zip files exceeding 4 GB

To use <zipArchive variable>.ChangePath on files exceeding 4 GB, the archive must have been created by <zipArchive variable>.Create with the constant zipHeader64.
Business / UI classification: Business Logic
Component: wd290zip.dll
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/21/2023

Send a report | Local help