I was wondering how i would make somethign like a jar file, basically a folder that cant be opened without special software, something that holds files like exe's, text files, etc, basically any type of file. how would i do that?
Nono, i dont want to make a jar file, a jar file holds files, i want to do somethin g like that with c++ i want to make a C++ version of a jar file. a file that cant be opened unless it has special software. I basically want to make my own version of a zip file, except i dont want anyone to be able to open it without special software that i make.
The JAR file format is built on the ZIP file format with the .jar file extention. Taken from wikipedia (http://en.wikipedia.org/wiki/JAR_%28file_format%29)
The ZIP file format uses the LZ77 and LZ78 (and Huffman coding) algorithms.
You can use these algorithms within a library at zlib.net.
The png file coincidentally also uses the same algorithm to compress 3 or 4 channel bitmap images.
No. If you put a directory on someone else's machine, they can get into it. It is their machine. They can read anything they like from the hard drive.
If you want to do this, you will have to put all your files into one big file, and obscure the way you did it, so that the end user cannot break the file down easily into the components. If you obscure it using a well-known system (as is done in jar files) the end user will be able to get into it using the right tool (like jar files). If you write your own system, they will not.
The easiest way is as Nexius said. Just use an existing compression library. They are very easy to use and much easier than writing your own.