Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter SixFile Functions (continued)

ZipExtractToFolder Function

Overview

The ZipExtractToFolder function extracts one or more files to a target destination.

Syntax/Parameters

Syntax

int = ZipExtractToFolder ( handle hZip | string zipname, string folder,
                       [int overwrite], [string mask] );

Parameters

hZip

A handle for a Zip Object created with the ZipOpen function. Or,

zipname

A string specifying the name of a zip file (or compatible file).

folder

A string specifying the destination folder. The value is automatically converted to MS style path delimiters and a backslash is added if required. The value should be a qualified path pointing to a drive letter or UNC location. The script must have appropriate access rights to the folder.

overwrite

An optional int specifying whether to overwrite existing files. The default is to not overwrite, or, FALSE. Set to TRUE to allow overwrite of files. (Programmers should not use non-zero since there are plans to change this parameter to a bitwise flags in the future with 0x00000001 as the overwrite flag.)

mask

An optional string specifying a mask for file selection or folders using optional wildcard characters. For example, “*.txt” would direct to extract only text files. When a match is employed, empty folders will not be created.

Return Value

Returns an int as the number of files extracted (not including folders) or a formatted error code on failure. On failure the return code can be ERROR_SOFT with the zero-based index of the file that failed in the low word of the error code. Use the GetLastError function to retrieve an additional error code. For example, a return of ERROR_SOFT with and index of 5 (0x80000005) coupled with a last error of ERROR_FILE and 32 (0x85000020) meaning that the 6th file failure on a sharing violation.

Remarks

The ZipExtractFile function only supports store and deflate modes (codes 0 and 8). Any other modes will result in the function returning the error ERROR_FUNCTION_NOT_SUPPORTED.

This function can seize the script thread for a long period of time if the files to be extracted are large.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic