|
- Reminder
- Example of extracted path
- Stored path
- Subscript of files in the archive
zipExtractPath (Function) In french: zipExtraitChemin
// Open the archive named "Archive" ResOpenArchive = zipOpen("Archive", "D:\Backups\Backup.zip") // in Windows Mobile: // ResOpenArchive = zipOpen("Archive", "\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) ... END
Archive is zipArchive // Open the archive named "Archive" ResOpenArchive = zipOpen(Archive, "D:\Backups\Backup.zip") // in Windows Mobile: // ResOpenArchive = zipOpen(Archive, "\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) ... END
Syntax
<Result> = zipExtractPath(<Archive> , <File subscript> [, <Path section to extract>])
<Result>: Character string Requested path section. <Archive>: Character string (with quotes) or zipArchive variable Name of archive to use. This name can correspond to: <File subscript>: Integer Subscript of file in the archive. This subscript is returned by zipFindFile. <Path section to extract>: Optional constant (or combination of constants) Section of file path to extract: | | zipDrive | Returns the unit name only (WDZ format only). This constant has no effect for the archives whose type differs from WDZ. | zipExtension | Returns the extension of the file (preceded by ".") | zipFilename | Returns the name of the file (without its extension) | zipDirectory | Returns the different directories of the file (the name and the extension of the file are not returned) | By default, the extracted path corresponds to the stored path.
Remarks 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
- ...
Archives in 7z format: The "\" character (beginning of the path) is not returned. 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". | | | | | zipAddFile | File location | zipNone | zipDirectory | zipDrive | zipAddFile("Archi",... "File.txt") | C:\Temp\File.txt | File.txt | File.txt | File.txt | zipAddFile("Archi",... "Data\File.txt") | C:\Temp\Data\File.txt | File.txt | Data\File.txt | Data\File.txt | zipAddFile("Archi",... "D:\Data\File.txt") | D:\Data\File.txt | File.txt | Data\File.txt | D:\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.
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 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.
Business / UI classification : Business Logic
This page is also available for…
|
|
|
| |
| Click [Add] to post a comment |
|
| |
|
| |
| |
| |
| |
| |
| |
| | |
| |