Classes are implemented using Lua meta-tables. It provides properties (get/set functions that acts as a member variable), enumerations (small and read-only classes to list constant values) and functions.

Enumeration syntax: enums.value

Property syntax: class.property

Function syntax: class:function(argument)

Enumerations

Filters

Dirs

Files

NoSymLinks

AllEntries

AllDirs

CaseSensitive

NoFilter

SortFlags

Name

Time

Size

DirsFirst

DirsLast

Reversed

IgnoreCase

Type

NoSort

OpenFlags

ReadOnly

WriteOnly

ReadWrite

ShareMode

Share

NoShare

AskToShare

Classes

File

isSequential [boolean: read-only property]: returns true if the file doesn't support random-access, otherwise false.

pos [integer: read-only property]: returns the current position of the file in bytes.

size [integer: read-only property]: returns the file size.

atEnd [boolean: read-only property]: returns true if reached the end of the file, otherwise false.

seek(pos: integer) [boolean: function]: for random-access files, this function sets the current position to pos, returning true on success, or false if an error occurred or on sequential files.

reset() [boolean: function]: seeks to the start of input for random-access files. Returns true on success; otherwise returns false.

Archive

name [string: read-only property]: returns the archive file name.

path [string: read-only property]: returns the archive file path.

absoluteFilePath(relativePath: string) [string: read-only property]: returns the absolute file path from relativePath.

absoluteFileName(relativePath: string) [string: read-only property]: returns the absolute file name (path + base name + extension) from relativePath.

isReadOnly() [boolean: read-only property]: returns true if this archive is read-only, otherwise returns false.

entries(path: string, nameFilters: string table, filters: Filters, sort: SortFlags) [string table: function]: returns a list of files/folders from path, filtering by nameFilters (wildcard list), filters and sort.

openFile(fileName: string, openFlags: OpenFlags) [File: function]: opens the file pointed by fileName on this archive using openFlags access mode. Returns a File class on success, otherwise returns nil. The returned class must be closed with closeFile to avoid memory leaks.

closeFile(file: File) [function]: closes file, freeing its memory.

removeFile(fileName: string) [boolean: function]: deletes the file pointed by fileName on this archive. Returns true on success, otherwise returns false.

renameFile(fileName: string, newFileName: string) [boolean: function]: renames the file pointed by fileName to newFileName on this archive. Returns true on success, otherwise returns false.

flush() [function]: flushes any pending write operation on this archive.

isWritable(fileName: string) [boolean: function]: returns true if the file pointed by fileName can be opened in write mode, otherwise returns false.

fileExists(fileName: string) [boolean: function]: returns true if the file pointed by fileName exists, otherwise returns false.

directoryExists(filePath: string) [boolean: function]: returns true if the directory pointed by filePath exists, otherwise returns false.

release() [function]: free this archive's memory (use only on objects returned by instance function).

instance(fileName: string, readOnly: boolean) [Archive: function]: returns an Archive instance capable of handling the file pointed by fileName.