Simple Zip functions

BlitzMax Forums/BlitzMax Programming/Simple Zip functions

Chroma(Posted 2008) [#1]
I'm totally missing the mark here. Anyone know why this doesn't work? I don't want to use an existing lib I just want a simple one with minimal functionality.

Local zip:TStream = ReadZip("media.zip")
image1 = LoadImage("zip::test.png")
CloseZip(zip)

Function ReadZip:TStream(zfolder$)
	Local stream:TStream
	stream = OpenStream(zfolder)
	Return stream
End Function

Function CloseZip(zstream:TStream)
	CloseStream(zstream)
End Function



Bremer(Posted 2008) [#2]
Using zip:: will only work if you use the zipstream module, its not a build in feature of Blitzmax. At least I don't seem to remember it is.


Chroma(Posted 2008) [#3]
Hmm...I'm trying TStreams and TBanks. Can't seem to get a simple image loaded from a zip file. :(


Brucey(Posted 2008) [#4]
Pub.Zip will decompress a zip data stream.

You need something like the ZipStream module to understand the pk-zip format which contains extra information for directory/file support.

Zip and Zip are not necessarily the same thing :-)


Chroma(Posted 2008) [#5]
I just decided to go with the zipstream module like you guys suggested. It's already working great and I didn't realize it was so time consuming to write. I have better things to do than re-invent the wheel. :)