Posted 03 January 2013 - 08:44 PM
I'm at a point with some of my programs where I have to upload 5 or 6 or more files to pastebin for them all to work together cohesively. This gets boring fast, so I wrote this app for larger projects to be easily send up and down again.
The compressor essentially takes and recursively parses through a directory, putting the contents of each file inside into a much larger text file. The process is then reversed by the extractor, preserving every file and the directory structure within.
It has a few problems. Firstly it doesn't decrease the file size at all, in fact it's quite a bit larger. I'm not sure if pastebin allows upload of binary files but if it does I'll look at adding huffman coding. Secondly, I've noticed io will time out on large files if you're running on a slow computer. Beware of this, not sure of a fix.
Anyway you can get it here:
Extractor: http://pastebin.com/461hnYHf
Compressor: http://pastebin.com/9PcVRBy6
And here's an example of what a compressed file will look like. It's basically a set of instructions to recreate the file- if I get around to it I'll try to make the archives self-extracting:
Hope someone finds it useful.
NF
The compressor essentially takes and recursively parses through a directory, putting the contents of each file inside into a much larger text file. The process is then reversed by the extractor, preserving every file and the directory structure within.
It has a few problems. Firstly it doesn't decrease the file size at all, in fact it's quite a bit larger. I'm not sure if pastebin allows upload of binary files but if it does I'll look at adding huffman coding. Secondly, I've noticed io will time out on large files if you're running on a slow computer. Beware of this, not sure of a fix.
Anyway you can get it here:
Extractor: http://pastebin.com/461hnYHf
Compressor: http://pastebin.com/9PcVRBy6
And here's an example of what a compressed file will look like. It's basically a set of instructions to recreate the file- if I get around to it I'll try to make the archives self-extracting:
Spoiler
MKDIR gunshot
MKDIR gunshot/artwork
MKFIL gunshot/artwork/cowstill.nfp
WRITE 10
cc
cccc
66
666
dd
dd
76
cc
ccc
MKFIL gunshot/artwork/shrub.nfp
WRITE 3
5 5
5
MKFIL gunshot/gunshot
WRITE 2
print("Gunshot the game")
print("Coming soon!")
MKFIL gunshot/readme.txt
WRITE 3
Gunshot is a game that will be coming out soon!
I guarantee it'll be okayish at least, awesome at best.
Stay tuned...
Hope someone finds it useful.
NF