|
- Error codes
- Extracted file
- Progress Bar
- Extraction on diskettes from a multi-part archive
zipExtractAll (Function) In french: zipExtraitTout Extracts all files from an archive and decompresses them. Syntax
<Result> = zipExtractAll(<Archive> [, <Destination of files> [, <Options>] [, <WLanguage procedure>] , [ <Progress bar management>]])
<Result>: Integer - 0 if the files have been extracted,
- An error code (value greater than 0) otherwise. For more details on these error codes, see the Remarks.
<Archive>: Character string (with quotes) or zipArchive variable Name of archive to use. This name can correspond to: <Destination of files>: Optional character string or constant Destination path of extracted files:- Optional character string: The files are extracted into the specified path to which is added the tree structure of each file (the disk is not stored). The specified path is created if it does not exist.
The destination path of the extracted file must correspond to the working directory of the application (returned by fDataDir) or one of its subdirectories. - Optional constant:
| | zipDrive | Extraction:- to the initial file location if it was stored and if the drive exists.
- while restoring the tree structure of the file on the current drive if the drive or the stored directory does not exist.
- into the current directory if only the file name and extension have been stored.
Remark: If the zipDrive constant is used, the WDZ format stores the full path of the file (including the drive letter) while the ZIP format does not store the drive letter.
 This constant is not available. The directories have no root.
  This constant and zipDirectory will have the same effect Archives in 7z format: This constant and zipDirectory will have the same effect. | zipDirectory | Extraction into the current directory while restoring the tree structure of file (if it was stored). | zipOverwrite | During the extraction, the existing read-only files are automatically overwritten by the extracted files. This constant can be combined with the zipDrive and zipDirectory constants.
  This constant is not available. |
<Options>: Optional constant Configure the extraction (if <Destination of files> corresponds to a character string):
| | zipOverwrite | During the extraction, the existing read-only files are automatically overwritten by the extracted files.
|
<WLanguage procedure>: Optional procedure name Versions 19 and laterName of the WLanguage procedure that will be called if an error occurs when extracting files. CAUTION: This parameter can be used only if <Archive> corresponds to a zipArchive variable. This procedure has the following format:
PROCEDURE <Procedure name>(<Error code>, <File name>)
where: - <Error code> is an integer corresponding to the code of the error that occurred when extracting the file.
- <File name> is a character string that contains the path of the file processed by zipExtractAll.
The procedure can return one of the following constants: | | zipCancel | Cancels the extraction of files from the archive. | zipIgnore | Ignores the file in error. | zipRetry | Retries the file extraction. |
New in version 19Name of the WLanguage procedure that will be called if an error occurs when extracting files. CAUTION: This parameter can be used only if <Archive> corresponds to a zipArchive variable. This procedure has the following format:
PROCEDURE <Procedure name>(<Error code>, <File name>)
where: - <Error code> is an integer corresponding to the code of the error that occurred when extracting the file.
- <File name> is a character string that contains the path of the file processed by zipExtractAll.
The procedure can return one of the following constants: | | zipCancel | Cancels the extraction of files from the archive. | zipIgnore | Ignores the file in error. | zipRetry | Retries the file extraction. |
Name of the WLanguage procedure that will be called if an error occurs when extracting files. CAUTION: This parameter can be used only if <Archive> corresponds to a zipArchive variable.This procedure has the following format:
PROCEDURE <Procedure name>(<Error code>, <File name>)
where: - <Error code> is an integer corresponding to the code of the error that occurred when extracting the file.
- <File name> is a character string that contains the path of the file processed by zipExtractAll.
The procedure can return one of the following constants: | | zipCancel | Cancels the extraction of files from the archive. | zipIgnore | Ignores the file in error. | zipRetry | Retries the file extraction. |
<Progress bar management>: Optional character string (with or without quotes) Versions 21 and laterMode for managing the progress bar. This parameter can correspond to: If you are using an archive: - in TAR or TGZ (TAR.GZ) format, the progress bar is refreshed at the end of the extraction of each file.
- in CAB and RAR format, the progress bar is refreshed at the end of the extraction of each file.
- in 7z format, only <Global progress percentage> is specified. <File progress percentage> will have the same value.
New in version 21Mode for managing the progress bar. This parameter can correspond to: If you are using an archive: - in TAR or TGZ (TAR.GZ) format, the progress bar is refreshed at the end of the extraction of each file.
- in CAB and RAR format, the progress bar is refreshed at the end of the extraction of each file.
- in 7z format, only <Global progress percentage> is specified. <File progress percentage> will have the same value.
Mode for managing the progress bar. This parameter can correspond to: If you are using an archive: - in TAR or TGZ (TAR.GZ) format, the progress bar is refreshed at the end of the extraction of each file.
- in CAB and RAR format, the progress bar is refreshed at the end of the extraction of each file.
- in 7z format, only <Global progress percentage> is specified. <File progress percentage> will have the same value.
Remarks Extracted file The extracted files are not deleted from the archive. To delete one file or all the files from the archive, use zipDeleteFile or zipDeleteAll. Business / UI classification : Business Logic
This page is also available for…
|
|
|
| |
| | https://youtu.be/8IBcU-guQfQ https://windevdesenvolvimento.blogspot.com/2019/03/dicas-2035-windev-curso-zip-2-zipopen.html // sBaixar_arquivo is string="c:\temp\teste.rar" IF fFileExist(sBaixar_arquivo)=True THEN zipOpen("ArquivoRar",sBaixar_arquivo) zipExtractAll("ArquivoRar","c:\temp\",zipOverwrite) Info("Arquivo Descompactado") ELSE Info("arquivo nao encontrado") END |
|
|
|
| |
| |
| |
|
| | //Salva Buffer em arquivo Zip em disco OK = fSaveBuffer(ArquivoZip,bufArquivoZip)
//Descompacta arquivo Zip ResExtractAll is int ResOpenArchive is int = zipOpen("Pacote", ArquivoZip) IF ResOpenArchive = 0 THEN // Returns the list of files found in the archive // Display the files in a list ArquivoTxt = zipListFile("Pacote") ResExtractAll = zipExtractAll("Pacote") IF fFileExist(ArquivoTxt) AND ResExtractAll = 0 descompactado = True ELSE descompactado = False END END IF ResOpenArchive = 0 OK = zipClose("Pacote") END |
|
|
|
| |
| |
| |
| |
| |
| |
| | |
| |