Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter SixFile Functions (continued)

6.8 Whole File Operations

6.8.1 Overview

This section covers functions that process complete files for copying, compressing and encoding.

6.8.2 File Compression

Individual or multiple files can be compressed and decompressed using Legato.

The ‘zip’ functions for Legato version 1 will process creating or extracting files within a Zip Object. when a zip (or compressed) file is opened with ZipOpen, entries can be acted upon and extracted. When a Zip Object is created using the ZipCreate function, files may be added and written to a zip file. An existing zip file cannot be altered.

The Zip Object only supports store and deflate compression modes. These are the most common methods of compression.

6.8.3 Whole File Functions

Compression:

CompressFile — Compress file using ZLIB with optional compression level.

DecompressFile — Decompress file using ZLIB.

ZipCreate — Creates an empty Zip Object.

ZipAddFile — Adds a file for compression to the Zip Object with optional path/tree location.

ZipWrite — Writes Zip Object data to a specified file.

Copying:

CopyFile — Copy a file to another name or location.

Encoding:

DecodeFile — Decodes a file (base-64) from source to destination with optional mode.

EncodeFile — Encodes a file (base-64) from source to destination with optional mode and padding.

Zip Reading Support:

ZipOpen — Opens a zip file and returns a Zip Object handle.

ZipEnumerateEntries — Gets a list of entries (files, folders) contained within a compressed object.

ZipEnumerateFiles — Gets a list of files contained within a compressed object.

ZipEnumerateFolders — Gets a list of folders contained within a compressed object.

ZipExtractFile — Extracts a file by index or entry name to a Basic File or Pool Object or simple filename and path.

ZipExtractToFolder — Extracts all files (or as selected by wild card mask) to a specified folder.

ZipExtractToString — Decompresses or extracts file entry data into a string. Presumably the contents are text.

ZipFindEntry — Finds an entry and returns the zero-based index position within Zip Object.

ZipGetEntryProps — Returns all the known index properties for a specified file entry in the compressed object.

ZipGetEntryCompressionType — Returns the compression type for an item by zero-based index.

ZipGetEntryCount — Gets the total count of files in the Zip Object's file index.

ZipGetEntryName — Gets the entry name by index position and adjusted path as required.

ZipGetEntrySize — Gets the uncompressed size of a file entry.

ZipGetFolderCount — Returns the number of discrete folders in the object.

Zip Writing Support:

ZipCreate — Creates an empty Zip Object.

ZipAddFile — Adds a file for compression to the Zip Object with optional path/tree location.

ZipWrite — Writes Zip Object data to a specified file.