PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Use conditions
  • Error codes
  • Stored path of archive files
  • Zip files exceeding 4 GB
  • Subscript of files in the 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
Modifies the stored path of a file in an archive (in ZIP, WDZ or 7z format). Used to configure the extraction path of file.
Versions 18 and later
WINDEVWindows This function now supports the 7z format.
New in version 18
WINDEVWindows This function now supports the 7z format.
WINDEVWindows This function now supports the 7z format.
WINDEVJavaUser code (UMC)
// Open an archive
ResOpenArchive = zipOpen("MyArchive", "C:\MyArchives\Archive.zip")
IF ResOpenArchive = 0 THEN
...
// Modify the stored path of File.doc
ResChangePath = zipChangePath("MyArchive", "File.doc", "Backup.doc")
...
END
 
WINDEVUser code (UMC)
MyArchive is zipArchive
// Open an archive
ResOpenArchive = zipOpen(MyArchive, "C:\MyArchives\Archive.zip")
IF ResOpenArchive = 0 THEN
...
// Modify the stored path of File.doc
ResChangePath = zipChangePath(MyArchive, "File.doc", "Backup.doc")
...
END
 
Syntax

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

<Result> = zipChangePath(<Archive name> , <File subscript> , <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 name>: Character string (with quotes)
Name of archive containing the file to modify (defined by zipOpen or zipCreate).
<File subscript>: Integer
Subscript of file to modify. This subscript is returned by zipFindFile.
<New file path>: Character string (with quotes)
New path to store for the file (up to 260 characters).

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

<Result> = zipChangePath(<Archive> , <File path> , <New file path>)
<Result>: Integer
  • 0 if the modification was performed,
  • An error code (value greater than 0) otherwise. See the Remarks for more details.
<Archive>: Character string (with quotes) or zipArchive variable
Name of archive where the file path must be modified.
This name can correspond to:
<File path>: Character string (with quotes)
Stored path of the file to modify.
<New file path>: Character string (with quotes)
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 (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. 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 zipChangePath is called.
  • Linux Only the archives in ZIP, TAR and TGZ (TAR.GZ) format are available.
  • Java 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.
  • 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 (zipAddFile and zipAddDirectory), 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 zipChangePath on files exceeding 4 GB, the archive must have been created by zipCreate with the constant zipHeader64.

Subscript of files in the archive

When a file is added into an archive, a subscript is automatically assigned to the file. This subscript corresponds to the order in which the files are included in the archive. To select a file found in the archive, you can use:
  • the subscript of the element (the subscript of an element is returned by zipFindFile).
  • the stored path of element.
Component : wd250zip.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment