AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de archivos
  • Example 1: Extracting all the files from the archive
  • Example 2: Extracting all the files from the archive while displaying a progress bar
zipExtractAll (Example)
Example 1: Extracting all the files from the archive
WEBDEV - Código ServidorAjax The following code is used to extract all the files from an archive and to decompress them. The stored path of the files contains: the name of the directories, the name and extension of the file. The extracted files are copied onto diskettes ("A:\Archive").
// Declare and initialize the variables
DirectoryName is string
ArchiveName is string = "MyArchive"
CreationErrorCode is int
AdditionErrorCode is int
ErrorCodeExtract is int
 
// Create an archive
CreationErrorCode = zipCreate(ArchiveName, "C:\Directory\Archives\ArchivePdf.wdz")
IF CreationErrorCode = 0 THEN
// Select the directory
DirectoryName = fSelectDir("", "", "Directory to add")
// Add all the files found in the selected directory
// and subdirectories to the archive
AdditionErrorCode = zipAddDirectory(ArchiveName, DirectoryName, True, zipDirectory)
IF AdditionErrorCode = 0 THEN
  // Extract and decompress the files
    // The files are copied onto diskettes
  ErrorCodeExtract = zipExtractAll(ArchiveName, "A:\Archive")
  // Display an error message if the files were not extracted
IF ErrorCodeExtract <> 0 THEN
Error(zipMsgError(ErrorCodeExtract))
END
ELSE
    // Display an error message if the files have not been added
    Error(zipMsgError(AdditionErrorCode))
END
ELSE
// Display an error message if the archive was not created
  Error(zipMsgError(CreationErrorCode))
END
Example 2: Extracting all the files from the archive while displaying a progress bar
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/05/2022

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