- Example of extracted path
- Stored path
- Index of files in the archive
In french: zipExtraitChemin
Returns the path of a file found in the archive. This archive can be in ZIP, CAB, RAR, WDZ or 7z format.
Archive is zipArchive
// Open the archive named "Archive"
ResOpenArchive = zipOpen(Archive, "D:\Backups\Backup.zip")
IF ResOpenArchive = 0 THEN
// Find the "File.txt" file
ResFileFound = zipFindFile(Archive, "File.txt")
// File path found
ExtractPath = zipExtractPath(Archive, ResFileFound, zipDirectory)
<Result> = zipExtractPath(<Archive> , <File index> [, <Path section to extract>])
<Result>: Character string
Requested path section.
<Archive>: Character string or zipArchive variable
Name of the archive to be used.
This name can correspond to:
<File index>: Integer
Index of file in the archive. zipFindFile returns this index.
<Path section to extract>: Optional constant (or combination of constants)
Section of file path to extract:
By default, the extracted path corresponds to the stored path.
This parameter is not available: only the name of the file and its extension are stored and therefore can be extracted.
Example of extracted path
If the stored path is "C:\Temp\Data\File.txt", zipExtractPath returns:
- zipExtension: .txt
- zipFilename: File
- zipDirectory: \Temp\Data\
- zipDrive: C:
- zipFilename+zipExtension: File.txt
- zipDirectory+zipFilename: \Temp\Data\File
constant is ignored.
Archives in 7z format
Only the name of the file and its extension can be extracted.
: The "\" character (beginning of the path) is not returned.
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".
: 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.
constant is ignored.
The directory and the disk are not stored in the archive path. Only the file name and extension are stored.
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 element.
Business / UI classification: Business Logic
This page is also available for…