|
|
|
|
- Use conditions
- Error codes
- Stored path of archive files
- Zip files exceeding 4 GB
- Index of files in the archive
zipChangePath (Function) In french: zipChangeChemin Modifies the stored path of a file in an archive (in ZIP, WDZ or 7z format). Used to configure the extraction path of file. Syntax
Changing the stored path of a file identified by its index Hide the details
<Result> = zipChangePath(<Archive name> , <File index> , <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 Name of archive containing the file to modify (defined by zipOpen or zipCreate). <File index>: Integer Index of the file to modify. zipFindFile returns this index. <New file path>: Character string 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. For more details on these error codes, see the Remarks.
<Archive>: Character string or zipArchive variable Name of archive where the file path must be modified. This name can correspond to: <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 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.
- Only ZIP, TAR and TGZ (TAR.GZ) 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 ( 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. Index of files in the archive When a file is added into an archive, an index is automatically assigned to the file. This index corresponds to the order in which the files are included in the archive. To select a file in the archive, you can use: - the index of the element (the index of an element is returned by zipFindFile).
- the stored path of the element.
Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|