Creating a .zip

Author Topic: Creating a .zip  (Read 1640 times)

Is it possible to create a .zip file using torque? I've been trying things like
%file.openforwrite("Add-Ons/Script_Test.zip/client.cs"); but that doesn't seem to work. I did manage to create one using that once though but it wouldn't open. Am I doing something wrong or is there a different method for creating .zips?

You'd do %file.openforwrite("Add-Ons/Script_Test/client.cs"); to open a file in a .zip/.rar/folder/anything. Only put the extension on the last one.


To create a zip, you have to create the .zip file itself. Not the contents.

Have fun.

You can't write to zip files from Torquescript.

Badspot should use a zip library other than an outdated version of zLib. :cookieMonster:

Whatever the case, you could just create a folder in TS. Blockland treats zips and folders as one in the same.

Badspot should use a zip library other than an outdated version of zLib. :cookieMonster:

It's more complicated than just throwing a zip library at something I'm afraid.

It's more complicated than just throwing a zip library at something I'm afraid.
If you are talking about updating and re-implementing a new library right in Blockland's source, then I laugh at you. Though it may take a bit more time, it's possible and there are other libraries out there that are way faster at zip i/o than zLib making them the logical choice. Programming a game is complicated, what do you expect?
« Last Edit: May 17, 2010, 10:15:47 AM by Radial543 »

Let me re-phrase because you clearly misunderstood the point of this thread.

It's more complicated than just throwing a zip library at the engine to get zip handling in Torquescript.

If you are talking about updating and re-implementing a new library right in Blockland's source, then I laugh at you. Though it may take a bit more time, it's possible and there are other libraries out there that are way faster at zip i/o than zLib making them the logical choice. Programming a game is complicated, what do you expect?
No, zlib doesn't have anything to do with .zip files, it just handles the deflate standard. zip can use deflate as a compression algorithm but that's up to the zip implementation, not zlib.

zlib is not just used for dealing with zip files, it is used for much more (for example the png standard uses the zlib format for its IDAT chunk (among others)). also, if you look at the source distrobution for zlib, it includes more than just an implementation of the deflate standard, it has stuff for calculating various checksums (namely crc32 and adler32) which is needed to implement gzip and stuff.
Also, zip doesn't necessarily need to use deflate as it's compression algorithm.

Also, you can't just link zlib with blockland and expect it to work, you must properly interact with it, and as all big libraries go, the newer the version, the more bloated it gets and you have more and more overhead to do the exact same thing as a previous version. The reason you would go through that trouble is if there was a security vulnerability in the version you currently use, or there is new functionality in the most recent library that you want to use, or that is a more efficient replacement to your current implementation, not because you think that linking a newer version of said library would magically have torque hook into it's api and expose a console method to create zips.

I don't want to seem mean or whatever, but please do your homework before coming here and posting a link to something you know about but do not understand as it is usually not relevant and doesn't help anyone.

Use WinRAR. It zips files.



No not really, I just thought it was a funny name.