AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de archivos
  • Error codes
  • Extracted file
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Extracts all files from an archive and decompresses them.
The archive handled can be in CAB, RAR, ZIP, WDZ, 7z, gzip, TAR or TGZ (TAR.GZ) format.
Novedad versión 2025
Windows The gzip format (.gz extension) is now supported.
Ejemplo
Reportes y Consultas
Archive is zipArchive

// Ouverture d'une archive
ResOuvreArchive = Archive.Ouvre("C:\Archives\Archive.zip")

IF ResOuvreArchive = 0 THEN
	...
	// Extraction de tous les fichiers de l'archive
	ResExtraitTout = Archive.ExtraitTout(zipDrive)
	...
END
Sintaxis
<Result> = <Archive>.Extractall([<Destination of files> [, <Options> [, <WLanguage procedure> [, <Progress>]]]])
<Result>: Integro
  • 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>: Variable de tipo zipArchive
Name of a variable of type zipArchive corresponding to the archive to use.
<Destination of files>: Cadena de caracteres opcional o constante
Destination path of extracted files:
  • Optional character string: files are extracted to the specified path plus the memorized tree structure for each file (the disk is not preserved). The specified path is created if it does not exist.
  • Optional constant:
    zipDirectoryExtraction into the current directory while restoring the tree structure of file (if it was stored).
    zipDriveExtraction:
    • 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 constant zipDisk is used, the WDZ format memorizes the complete path of the file (including the drive letter), whereas the ZIP format memorizes only the drive letter..





    Archives in format 7z: This constant will have the same effect as the constant zipDirectory.
    zipOverwriteDuring 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.
<Options>: Constante opcional
Configure the extraction (if <Destination of files> corresponds to a character string):
zipOverwriteDuring the extraction, the existing read-only files are automatically overwritten by the extracted files.
<WLanguage procedure>: Nombre de procedimiento opcional
Name of the WLanguage procedure that will be called if an error occurs when extracting files.
WARNING: This parameter can only be used if the <Archive> parameter corresponds to a variable of type zipArchive.
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 <zipArchive variable>.ExtractAll.
The procedure can return one of the following constants:
zipCancelCancels the extraction of files from the archive.
zipIgnoreIgnores the file in error.
zipRetryRetries the file extraction.

<Progress>: Nombre del control o del procedimiento
Progress bar management mode. This parameter can correspond to:
  • the name of a WLanguage procedure. This procedure has the following format:
    PROCEDURE <Procedure name> (<Current file>,
    <Global progress percentage>, <File progress percentage>)

    where:
    • <Current file> corresponds to the name of the file currently processed.
    • <Global progress percentage> corresponds to the progress percentage of the extraction of files from the archive.
    • <File progress percentage> corresponds to the progress percentage of the file being extracted from the archive.
If you handle an:
  • in gzip, TAR or TGZ (TAR.GZ)format, the ProgressBar is updated only at the end of 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 <Overall progress percentage> is specified. <File progress percentage> will have the same value.
Observaciones

Error codes

The following error codes are returned:
  • 1: The path passed in parameter does not exist.
  • 2: Access denied: user does not have sufficient rights.
  • 3: The archive is corrupt.
  • 4: The path does not exist in the archive.
  • 6: Sub-archive files are not in order (case of extraction from a multi-part archive).
The message corresponding to the error code is returned by zipMsgError.
Reminder:
  • RAR is supported up to and including version 5.

Extracted file

The extracted files are not deleted from the archive. To delete one file or all the files from the archive, use <zipArchive variable>.DeleteFile or <zipArchive variable>.DeleteAll.
Componente: wd300zip.dll
Versión mínima requerida
  • Versión 24
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 30/09/2024

Señalar un error o enviar una sugerencia | Ayuda local