Die Oberfläche von VDS Renaissance ist in mehreren Sprachen verfügbar. Die offizielle Dokumentation wird auf Englisch gepflegt, um eine einheitliche, konsistente und stets aktuelle Referenz zu gewährleisten.

ZIP archives

[VDS7] DialogScript can create and read standard .zip archives natively — the ZIP engine is built into the core, so no extra DLL is needed. Optionally, archives can be encrypted with a password (WinZip AES-256).

Writing an archive uses a handle, in the same style as JSON or XML documents: you open the archive, add files to it, then close it (which writes it to disk). Reading and extracting work directly on an archive file and need no handle.

Creating an archive

%z = @new(zip,backup.zip)
zip add,%z,FILE,report.txt
zip add,%z,FILE,data.csv
zip add,%z,DIR,images,R
zip close,%z
  • @NEW(zip,<archive>[,<password>]) opens an archive for writing and returns a handle. If a password is given, the archive is encrypted with WinZip AES-256.
  • ZIP add,%z,FILE,<file> adds a file (stored under its base name); add,%z,DIR,<dir>{,R} adds a folder, with R to include sub-folders.
  • ZIP close,%z writes the archive to disk and releases the handle. Nothing is written until you close.

Extracting

zip extract,backup.zip,C:\restore
zip extractfile,backup.zip,report.txt,C:\restore
  • ZIP extract,<archive>{,<folder>}{,<password>} extracts everything (to the current folder if none is given).
  • ZIP extractfile,<archive>,<entry>{,<folder>}{,<password>} extracts a single named entry.
  • Supply the password as the last parameter for an encrypted archive.

Encryption

If you give a password to @NEW(zip,<archive>,<password>), the archive is encrypted with AES-256 in the standard WinZip AE-2 format. These archives are fully interoperable: they open in 7-Zip, WinRAR and WinZip, and conversely DialogScript can extract AES archives produced by those tools.

%z = @new(zip,secret.zip,MyPassPhrase)
zip add,%z,FILE,private.txt
zip close,%z
zip extract,secret.zip,C:\out,MyPassPhrase

To read an encrypted archive, supply the same password as the last parameter of ZIP extract or extractfile. The encryption is authenticated: extraction verifies each entry, so a wrong password — or a tampered archive — fails with nothing written, and @ZIP(error) reports the reason. Entry names can still be listed with @ZIP(list,...) without the password; only the file contents are protected.

Inspecting an archive

%n = @zip(count,backup.zip)
write console,@zip(list,backup.zip)@lf()
if @zip(exists,backup.zip,report.txt)
  info report.txt is in the archive
end

The @ZIP function reads an archive without extracting it: count, list, exists, and error (the message from the last ZIP operation).

See also