|
|
|
|
|
Archiving functions (management of ZIP, WDZ, CAB, RAR, 7z, TAR and TGZ (TAR.GZ))
Remark: These functions are also available in prefix syntax ( Archiving functions (management of ZIP, WDZ, CAB, RAR, 7z, TAR and TGZ (TAR.GZ)) (prefix syntax)).
The following WLanguage functions are used to create and manage archives: | | zipAddDirectory | Adds all the files found in a directory and in its subdirectories into an archive and compresses them. | zipAddFile | Adds a file (of any type) into an archive in CAB, ZIP, WDZ and 7z, TAR or TGZ (TAR.GZ) format and compresses it. | zipAddFileList | Adds a list of files (of any type) into an archive in ZIP, CAB, WDZ or 7z format and compresses it. | zipChangePath | Modifies the stored path of a file in an archive (in ZIP, WDZ or 7z format). | zipClose | Closes an archive. | zipCompressionLevel | Changes the compression level used when creating an archive in ZIP format or in 7z format. | zipCreate | Creates an archive. | zipCreateExe | Creates a self-extracting archive as a 32-bit executable (.EXE). | zipCurrentFile | Returns the name of the archived file currently handled by the functions for adding and extracting files. | zipDeleteAll | Deletes all files from an archive. | zipDeleteFile | Deletes a file from an archive. | zipDeleteFileList | Deletes a list of files from an archive. | zipExist | Used to find out whether an archive exists. | zipExtractAll | Extracts all files from an archive and decompresses them. | zipExtractDirectory | Automatically extracts and decompresses files from a directory in the file tree of an archive to a physical location. | zipExtractFile | Extracts a file from an archive and automatically decompresses it to a physical location or in memory. | zipExtractFileList | Extracts and decompresses a list of files found in an archive to a physical location. | zipExtractPath | Returns the path of a file found in the archive. | zipFileSize | Returns the size of one of the files found in the archive (in CAB, RAR, WDZ, ZIP, 7z, TAR or TGZ (TAR.GZ) format):- the compressed size of the file.
- the size of file before compression.
| zipFilter | Returns the list of archive formats supported by the current platform, in the format expected by the filter of fSelect. | zipFindFile | Finds a file in an archive (in CAB, ZIP, RAR, WDZ or 7z format). | zipInfoFile | Returns the characteristics of a file found an archive:- The name of the file and its stored path.
- The initial size of the file.
- The compressed size of file.
- The date and time of file creation.
- The date and time of file modification.
- The date and time of file access.
- The file attributes.
- The file encryption mode.
| zipIsMulti | Returns the type of archive: single-part archive or multi-part archive. | zipListFile | Returns the list of files found in an archive. | zipMerge | Merges the different sub-archives found in a multi-part archive to create a single-part archive. | zipMsgError | Returns the message associated with an error code on an archive. | zipNbFile | Returns the number of files found in an archive (in CAB, RAR, ZIP, WDZ or 7z format). | zipNbPart | Returns the number of sub-archives (parts) found in an archive in CAB, RAR, ZIP, WDZ, 7z, TAR or TGZ (TAR.GZ) format. | zipNbPartNeeded | Returns the number of parts of a given size required to split a single-part archive. | zipOpen | Opens an existing archive. | zipOpenCAB | Opens an existing archive in CAB format. | zipOpenRAR | Opens an existing archive in RAR format. | zipPassword | Defines the password used to add files into the specified archive and to extract files from the specified archive (RAR, ZIP and WDZ format). | zipSelectFile | Selects files from an archive. | zipSize | Returns the size of archive (in ZIP, RAR, CAB, WDZ or 7z format):- the size of all compressed files found in the archive.
- the size of all files found in the archive before compression.
| zipSplit | Splits an archive into several sub-archives of a given size. |
Remark: The archiving functions can be used in a thread without locking the other threads during their execution.
Related Examples:
|
Unit examples (WINDEV): The ZIP functions
[ + ] Using the compression/decompression functions of WINDEV: - Create an archive - Add files into an archive - Read the content of an archive - Extract files from an archive
|
|
Complete examples (WINDEV): WD Zip
[ + ] This example presents the use of archiving WLanguage functions with compression. The following topics are presented in this example: 1/ How to create an archive? 2/ How to compress and uncompress files? 3/ How to manage Drag&Drop from the file explorer of Windows to a TreeView control? Summary of the example supplied with WINDEV: This example allows you to create and read compressed archives in WDZ, ZIP, CAB and RAR format (in read-only). This feature can be very useful to manage the automatic backups. Furthermore, the example allows you to create multi-volume archives.
|
|
Android (WINDEV Mobile): Android ZIP
[ + ] This example is used to browse the folder of the Android device while searching for ZIP archives. The archives can be browsed and extracted into a directory of the device. The folders and the files found in the archive can be extracted individually.
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|