SDL and Zip Files

BlitzMax Forums/Brucey's Modules/SDL and Zip Files

RustyKristi(Posted 2016) [#1]
I would assume you cannot do this with Zip modules like zipstream..

zip.Open("sdl::myfile.zip")

It's throwing out errors that it can't open the zip file


Brucey(Posted 2016) [#2]
If the API has a stream interface, you could pass a TStream into it.

Or perhaps something like "zip::sdl::myfile.zip" would work - depending on how the module is set up to process streams.


RustyKristi(Posted 2016) [#3]
Thanks Brucey, I think it's gman's zip module that is in the works here.

Here's the part where it pulls out the zip for reading..

zip.OpenZip(filename)
Local xmlstream:TStream = zip.ExtractFile("DATA.XML")

Edit: got it to work without using zip for now though the zip stuff would be cool though


Local xmlstream:TStream = ReadStream("sdl::DATA.XML")

Still not sure how to go about using zip and sdl..


Brucey(Posted 2016) [#4]
It seems, one would need to implement a custom zlib_filefunc_def with TStream support. (i.e. to read/seek/etc through a TStream object)

... which the koriolis module appears to do.


RustyKristi(Posted 2016) [#5]
I don't mind not using zip because it looks complicated enough and with sdl it's new.

I guess I should try a simple sdl+zip example.

Would you recommend any archiving tool (tar or any no compression) that is already a module and will work on sdl?


Brucey(Posted 2016) [#6]
Why don't you try the koriolis zipstream module?