Skip to content
IgorTimofeev edited this page Feb 8, 2019 · 2 revisions

This library implements the methods of packing/unpacking files and directories into/from a single package for further use. It's very convenient to pack a huge amount of nested files and upload it to Pastebin for sharing with your friends. For now, this library doesn't compress the input data, but it supports encoding methods concept, so this functionality may be implemented in the future.

compressor.pack(string outputPath, string[] fileList): boolean success, string reason

Packs files from given fileList into a single file package on outputPath. Returns true on success, false and reason message otherwise.

compressor.pack("/Archive.pkg", {
	"/MyFile1.lua"
	"/MyFile2.lua",
	"/MyPictures/"
})

compressor.unpack(string packagePath, string outputPath): boolean success, string reason

Unpacks an package file from given packagePath into a outputPath directory. Overwrites existing files with the same names. Returns true on success, false and reason message otherwise.

compressor.unpack("/Archive.pkg", "/UnpackedFiles/")