The "xzip_count" Function

Syntax

xzip_count(arch);
ArgumentTypeDescription
archstringThe full path and filename of the archive to check

Description

Returns the number of files in the given archive created with xzip_create. An empty archive will return 0, or -1 if it doesn't exist at all.

Example

my_zip = xzip_create("C:\\archive.xz");
if (xzip_count(my_zip) == 0) {
xzip_add(my_zip, "C:\\file1.txt", "C:\\file2.zip");
}

This will create a new archive and only add contents to it if it is empty. This technique can be used to prevent repeatedly adding archive contents in Step events, which are run every frame, for example.