Posted 15 August 2016 - 11:33 PM
They said it couldn't be done and would take forever to run on a ComputerCraft computer. Well, that's not so! Now you can finally open up 7-Zip (shameless plug for my favorite archiver) or Terminal and tar gibberish to compress and archive your files over for transit!
I originally started this project to get past a server's HTTP API ban (using MineCopy) so that my files would take much less long to get sent over. Then I added the tar functionality so I could send multiple files at once (and increase overall compression efficacy). So here goes:
This package contains a whole bunch of junk that will shamelessly pollute your global namespace, thanks to its copy-paste origin.
It includes a Pythonic option parser (read up on optparse), a bit library, a library to calculate CRC-32 digests, the lovely DEFLATE library, and finally the untar functionality. Please remember that because of the copy-pasty nature of the program, it heavily assigns to the global namespace (just look at the beginning) and is filled with countless shims. The program WILL run on your standard computer Lua 5 installation, with the exception of the untar functionality not working with any directory other than the current working directory.
A few useful functions:
local opt = optparse().OptionParser{usage, version}
local DEFLATE = deflatelua()
DEFLATE.gunzip(input=,output=,disable_crc=)
Check out the source for more! A simple loadfile() will load this.
Download:
http://pastebin.com/SA3FBVMR
NOTE: PLEASE MINIFY BEFORE PUTTING ONTO SERVERS. I CANNOT DO SO BECAUSE THAT WOULD BE VIOLATING THE LICENSES OF THE CONTAINED SOFTWARE.
I originally started this project to get past a server's HTTP API ban (using MineCopy) so that my files would take much less long to get sent over. Then I added the tar functionality so I could send multiple files at once (and increase overall compression efficacy). So here goes:
This package contains a whole bunch of junk that will shamelessly pollute your global namespace, thanks to its copy-paste origin.
It includes a Pythonic option parser (read up on optparse), a bit library, a library to calculate CRC-32 digests, the lovely DEFLATE library, and finally the untar functionality. Please remember that because of the copy-pasty nature of the program, it heavily assigns to the global namespace (just look at the beginning) and is filled with countless shims. The program WILL run on your standard computer Lua 5 installation, with the exception of the untar functionality not working with any directory other than the current working directory.
A few useful functions:
local opt = optparse().OptionParser{usage, version}
local DEFLATE = deflatelua()
DEFLATE.gunzip(input=,output=,disable_crc=)
Check out the source for more! A simple loadfile() will load this.
Download:
http://pastebin.com/SA3FBVMR
NOTE: PLEASE MINIFY BEFORE PUTTING ONTO SERVERS. I CANNOT DO SO BECAUSE THAT WOULD BE VIOLATING THE LICENSES OF THE CONTAINED SOFTWARE.