546 posts
Location
Wageningen, The Netherlands
Posted 18 March 2015 - 09:51 PM
Packager is a really useful program if you want to compress a folder into a single executable file (to publish on pastebin for example).
Usage:
packager <directory> <output file> [display name]
When you run packager it will compress a folder into a file (note that the paths are relative unless it starts with an /).
When you run the file it will ask:
Where do you want to extract <display name>?
If a file/directory with the same name already exists, it will be deleted.
Note: You can not compress files that have bytes higher than 127.
Download:
pastebin get
Wy5vb6p0 packager
If you have any suggestions, bug reports or questions then please leave a reply.
Edited on 02 April 2015 - 11:18 AM
2427 posts
Location
UK
Posted 18 March 2015 - 10:13 PM
Self extracting files, I've been waiting for one of these. Does it actually compress (make the files smaller) too?
Edited on 18 March 2015 - 09:15 PM
546 posts
Location
Wageningen, The Netherlands
Posted 19 March 2015 - 07:02 AM
Self extracting files, I've been waiting for one of these. Does it actually compress (make the files smaller) too?
Nope, it converts the contents to base64 so you can upload binary files to pastebin.
2427 posts
Location
UK
Posted 19 March 2015 - 07:43 AM
Feature request, file size shrinking (bonus for IRL compressed file format, .7z .zip .tar.gz -
someone has made tar format)
Edited on 20 March 2015 - 06:56 AM
1029 posts
Location
Missouri, United States, America, Earth, Solar System, Milky Way, Universe 42B, Life Street, Multiverse, 4th Dimension
Posted 19 March 2015 - 11:15 PM
so you can upload binary files to pastebin.
This allows you to upload binary files? YESSSSSSSSS I've been needing this!!!!!!!!!!!
Right now, when installing game-engine, the testing map is stored as a table and is converted by the installer. So it's a pointless fs call.
1140 posts
Location
Kaunas, Lithuania
Posted 20 March 2015 - 06:46 AM
so you can upload binary files to pastebin.
This allows you to upload binary files? YESSSSSSSSS I've been needing this!!!!!!!!!!!
Right now, when installing game-engine, the testing map is stored as a table and is converted by the installer. So it's a pointless fs call.
And what about
Bomb Bloke's script? It does the same, and even more - compression!
546 posts
Location
Wageningen, The Netherlands
Posted 20 March 2015 - 07:49 AM
so you can upload binary files to pastebin.
This allows you to upload binary files? YESSSSSSSSS I've been needing this!!!!!!!!!!!
Right now, when installing game-engine, the testing map is stored as a table and is converted by the installer. So it's a pointless fs call.
And what about
Bomb Bloke's script? It does the same, and even more - compression!
Wow that looks nice! But it doesn't support empty directories.
I will probably add compression in the future.
Feature request, file size shrinking (bonus for IRL compressed file format, .7z .zip .tar.gz - someone has made tar format)
I will add compression soon!
2427 posts
Location
UK
Posted 20 March 2015 - 07:57 AM
546 posts
Location
Wageningen, The Netherlands
Posted 20 March 2015 - 08:05 AM
Thanks, but the file should be executable in CC.
I'm going to search for some simple compression algorithms in lua.
98 posts
Location
Australia
Posted 20 March 2015 - 11:41 PM
I found that post with the .tar format archiver, I've added it to my previous post too.
http://www.computerc...ar-files-in-cc/
That implementation doesn't have compression, so it's useless in this regard.
Thanks, but the file should be executable in CC.
I'm going to search for some simple compression algorithms in lua.
Keep in mind that you have to put the decompression script in every packaged file so it can decompress itself, so stay clear of any 30kb Huffman encoding algorithms.
2427 posts
Location
UK
Posted 20 March 2015 - 11:55 PM
-snip-
The point was that someone had made a program that used a real life file format. I did reference my previous post, maybe you should have read it.
98 posts
Location
Australia
Posted 21 March 2015 - 01:21 AM
The point was that someone had made a program that used a real life file format. I did reference my previous post, maybe you should have read it.
Assuming this is the post in question:
Feature request, file size shrinking (bonus for IRL compressed file format, .7z .zip .tar.gz -
someone has made tar format)
\
You're asking for compression, and you state that it's a "bonus" if a real life format was used. The TAR implementation in CC doesn't support compression, so the first criteria is invalidated, therefore providing no fulfillment towards your request.
I don't think you've read your own post.
7083 posts
Location
Tasmania (AU)
Posted 21 March 2015 - 01:48 AM
It's a bit of a moot point, considering that you can only upload / download ASCII.
2427 posts
Location
UK
Posted 21 March 2015 - 10:28 AM
.tar.gz is a combined format the .gz provides compression
anyway, enough arguing.
Edited on 21 March 2015 - 09:28 AM
546 posts
Location
Wageningen, The Netherlands
Posted 21 March 2015 - 11:19 AM
It's a bit of a moot point, considering that you can only upload / download ASCII.
It converts binary data to base64 so you can upload everything to pastebin.
7083 posts
Location
Tasmania (AU)
Posted 21 March 2015 - 01:35 PM
That's great and all, but then what are you going to do - paste that content into your compression software of choice? ;)/>
You'll need a go-between converter, so it doesn't matter so much as to whether the pre-base64'd file uses a "standard" format or not.
546 posts
Location
Wageningen, The Netherlands
Posted 21 March 2015 - 04:31 PM
I've updated Packager to use LZW compression and a more efficient way to make directories and files, and this can make the output file sometimes even smaller than the directory you compress.
To download it use the same command as before:
pastebin get
Wy5vb6p0 packager
The usage is also exactly the same, you just see the difference in size.
Screenshot:
Spoiler
Left: Directory
Middle: File generated with the old Packager
Right: File generated with the new Packager
100 posts
Posted 25 March 2015 - 09:17 AM
Can I use this in my OS?
546 posts
Location
Wageningen, The Netherlands
Posted 25 March 2015 - 10:08 AM
Can I use this in my OS?
Of course :D/>
This program was made for those kinds of things.
2679 posts
Location
You will never find me, muhahahahahaha
Posted 29 March 2015 - 12:40 PM
Packager 70: too long without yielding.
The folder I was trying to compress is
this one.
If you want to get the folder structure, type this:
pastebin run 2DMDuHci TheOS
~Creator
546 posts
Location
Wageningen, The Netherlands
Posted 29 March 2015 - 09:25 PM
Packager 70: too long without yielding.
The folder I was trying to compress is
this one.
If you want to get the folder structure, type this:
pastebin run 2DMDuHci TheOS
~Creator
The code doesn't yield, so it probably won't compress files larger than 100-200kB.
I just found out that fs.open changes the bytes above 128, so that sucks.
Do you have any binary files in your OS?
I was able to compress the folder but it couldn't extract.
I'll probably make an update in the future, but now I'm busy, sorry.
1140 posts
Location
Kaunas, Lithuania
Posted 29 March 2015 - 10:24 PM
There is an "rb" and a "wb" file open mode for reading and writing in binary.