This is a little api I wrote that lets you save a directory to a single file. It's like a zip/rar/whatever file, but without compression (for now), so in most cases the file will be larger than the directory.
The package is a binary file, so you can include any binary files and they should pack/unpack correctly.
I wrote it while working on something bigger, but I thought that someone might find this usefull (probably not, but whatever ).
So, here it is:
Download:
pastebin get gx10mzbk
Functions:
package.pack(path, outPath) -- pack directory "path" to file "outPath" --[[ Packs a directory Parameters: - path: the path to the directory to pack - outPath: the path to save the package file Return Values: - result: boolean indicating if the operation was successful - error: error message in case of error --]] package.load(path) --[[ Loads a package file Parameters: - path: the path to the package file Return Values: - entries: table containing the package entries. nil in case of error - error: error message in case of error --]] package.unpack(path, outPath) --[[ Unpacks a package file Parameters: - path: the path to the package file - outPath: the path to save the directory Return Values: - result: boolean indicating if the operation was successful - error: error message in case of error --]]
Examples:
Pack:
Spoiler
Unpack:
Spoiler
Any feedback and bug reports are welcome.