zipDir()

The function creates a zip file from the specified directory.

Synopsis

int zipDir(const string &dir, const string &zipArchiveFile, bool includeDir = true);

Parameters

Parameter Description
dir Complete native directory path.
zipArchiveFile Complete native path to the zip file.
includeDir If true (default), /p dir is included as the top directory in the zip file. If false, the content of /p dir is included directly (without including /p dir).

Return value

  • The function returns 0 if it was executed successfully.
  • In the event of errors, the function returns -1 if an empty or non-existent directory or archive file is specified.
  • The function returns -2 if the executable file 7-Zip (WIN) or zip (Linux) is not available.
  • The function returns -3 if the command execution fails.

Description

The function creates a zip file from the specified directory. Empty directories are ignored.

Assignment

File functions

Availability

UI, CTRL