PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Error codes
  • Special case of the .GZ extension
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Opens an existing archive.
For the archives in "CAB" or "RAR" format, the archive is created if it does not exist.
The archive can be:
  • in WinZip or PKZip format (.ZIP extension).
  • in WINDEV format (.WDZ extension).
  • in Cabinet file format (.CAB extension).
  • in RAR format (.RAR extension).
  • Versions 18 and later
    in 7z format (.7z extension).
    New in version 18
    in 7z format (.7z extension).
    in 7z format (.7z extension).
  • Versions 21 and later
    in TAR format (.TAR extension).
    New in version 21
    in TAR format (.TAR extension).
    in TAR format (.TAR extension).
  • Versions 21 and later
    in TGZ format (.TGZ extension).
    New in version 21
    in TGZ format (.TGZ extension).
    in TGZ format (.TGZ extension).
  • Versions 21 and later
    in TAR.GZ format (.TAR.GZ extension).
    New in version 21
    in TAR.GZ format (.TAR.GZ extension).
    in TAR.GZ format (.TAR.GZ extension).
  • an executable (.EXE) corresponding to a .WDZ file changed into a self-extracting archive.
Versions 18 and later
Windows This function now supports the 7z format.
New in version 18
Windows This function now supports the 7z format.
Windows This function now supports the 7z format.
Versions 21 and later
Windows This function now supports the TAR and TGZ (TAR.GZ) formats.
New in version 21
Windows This function now supports the TAR and TGZ (TAR.GZ) formats.
Windows This function now supports the TAR and TGZ (TAR.GZ) formats.
Reports and Queries
MonArchive is zipArchive
// Ouverture d'une archive
ResOuvreArchive = zipOpen(MonArchive, "C:\MesArchives\Archive.zip")
 
// Affichage du message d'erreur si l'archive n'a pas été ouverte
IF ResOuvreArchive <> 0 THEN
Error(zipMsgError(ResOuvreArchive))
END
Syntax
<Result> = zipOpen(<Archive> , <Archive path> [, <Opening mode>])
<Result>: Integer
  • 0 if the archive was opened,
  • An error code (value greater than 0) otherwise. For more details on these error codes, see the Remarks.
<Archive>: Character string or zipArchive variable
Name of archive to use.
This name can correspond to:
  • or to the name of an archive defined with function zipOpen or function zipCreate.
  • Versions 15 and later
    Reports and Queries the name of a variable of type zipArchive.
    New in version 15
    Reports and Queries the name of a variable of type zipArchive.
    Reports and Queries the name of a variable of type zipArchive.
The archive is created if it does not exist (except for the "CAB" or "RAR" formats).
<Archive path>: Character string
Path and name of archive (up to 260 characters). The archive extension can be specified. If the archive extension is not specified, the default extension is .WDZ.
<Opening mode>: Optional constant (or combination of constants)
Archive opening mode:
zipCreateIfNotFoundCreates the archive if it does not exist
(not available for .CAB and .RAR files)
zipWriteOpening in read/write
(not available for .CAB and .RAR files)
zipHeader64Allows you to create an archive larger than 4 GB on which zipChangePath can be used.
Versions 21 and later
Archive in TAR or TGZ (TAR.GZ) format: This constant is not available.
New in version 21
Archive in TAR or TGZ (TAR.GZ) format: This constant is not available.
Archive in TAR or TGZ (TAR.GZ) format: This constant is not available.
zipReadOpening in read-only

The default opening mode is: zipCreateIfNotFound + zipWrite.
Remarks

Error codes

The following error codes are returned:
  • 1: The path passed as parameter does not exist.
  • 2: Access denied: the user has no sufficient rights.
  • 3: The archive is corrupted.
  • 6: The files of the sub-archives are not arranged in order (when opening a multi-part archive).
The message corresponding to the error code is returned by zipMsgError. Reminder:

    Special case of the .GZ extension

    '.tar.gz' files generated by GitHub should not be confused with compressed '.gz' files.
    Content compressed in gzip format can be decompressed with Uncompress.
    Business / UI classification: Business Logic
    Component: wd270zip.dll
    Minimum version required
    • Version 9
    This page is also available for…
    Comments
    Video ZipOpen
    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
    amarildo
    06 Mar. 2019