creating a zip at run time

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
FoxHound
Posts: 10
Joined: Fri Nov 18, 2005 2:11 pm

creating a zip at run time

Post by FoxHound »

I'm trying to great a zip and add images to it at run time. However I can't seem to find a way to do that. If I use


createAndWriteFile("newzip.zip",false);

It will make a file called "newzip.zip" but it will give me errors and when change of extention to txt it acts as a text file, which I've assumed to be all that "creatandwritefile" can make. I've searched the manual and the fourm and I can't find anything that seems to work.

Thanks for any help.
jontan6
Posts: 278
Joined: Fri Jun 13, 2008 5:29 pm

Post by jontan6 »

you can try

http://www.zlib.net/ or
http://www.codeproject.com/KB/files/zip_utils.aspx

does irrlicht have? or just reader?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Irrlicht can only read from zip files ATM.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

A file's type is basically defined by its extension and the format of its contents define whether it's a valid file of that type...

You can rename any file to .txt and you'll be able to open it in notepad or whatever, but it won't necessarily have anything readable in it.

A file is just a collection of data... and that's what you can create with the file writing functions. So if you wanted to create a zip file you'd have to output the data in the correct format that a zip file requires. Obviously that's not trivial as it's compressed data and the like.
Image Image Image
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The zlib already supports this, it's just not available from within Irrlicht AFAIK.
FoxHound
Posts: 10
Joined: Fri Nov 18, 2005 2:11 pm

Post by FoxHound »

Thank you Hybrid and JP.

Is there any idea if Irrlicht will support this in the future? If not I might work on using Zlip myself and implant this.

Thanks.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

If you can write it into Irrlicht's IO framework somehow then you can submit it as a patch so everyone else can enjoy it ;)
Image Image Image
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Zip files are not tightly integrated into Irrlicht's Filesystem structure, which makes such additions usually a little clumsy by design. But there's no thing which would prohibit such an enhancement. The new filesystem layout should make this simpler, though, but there's no date fixed, yet, when we'll even start with it :wink:
Post Reply