Skip to main content

The "xzip_recurse" Variable

Description#

xzip_recurse is not a function, but rather a macro for a built-in variable that enables or disables recursive folder operations in any function that accepts folders as inputs.

By default, xzip_recurse is set to false, meaning only files in the exact directory specified will be considered in folder operations. To include subfolders as well, set xzip_recurse to true. This setting is global and will apply to all Xzip functions.

This is especially useful when (but not limited to) using the xzip_list_dir and xzip_count_dir functions.

Example#

xzip_recurse = true;
my_zip = "C:\\archive.xz";
my_folder = "my\\sub\\folder";
my_list = xzip_list_dir(my_zip, my_folder, true);
my_count = xzip_count_dir(my_zip, my_folder);
draw_text(25, 25, "Found " + string(my_count) + " items:");
for (var i = 0; i < array_length_1d(my_list); i++) {
draw_text(25, 25 + (25*i), my_list[i]);
}

This will display a count of all items found in the given folder and any subfolders below, as well as list out the file names including relative paths.