Topic: Bug appending to an empty zip?
Hello, if you create a new zip file then close it again so you have a blank zip, then later open it again to append to nothing seems to get added to the zip. Here's an example adapted from the last bug example:
SuperStrict
Framework brl.basic
Import gman.zipengine
Import brl.pixmap
Import brl.pngloader
Local zip:ZipWriter = New ZipWriter
zip.OpenZip("test.zip", False)
zip.CloseZip()
'Create 10 pixmaps and save into a stream in the format:
'Int (size of png)
'Png file
'Int (size of png)
'Png file
'Int (size of png)
'Png file
'.. etc
Local iconbank:TBank = CreateBank()
Local tempstream:TStream = WriteStream(iconbank)
For Local c:Int = 1 To 10
Local pixmap:TPixmap = CreatePixmap(32, 32, PF_RGBA8888)
pixmap.WritePixel(c, c, $FFFFFFFF)
Local tempbank:TBank = CreateBank()
SavePixmapPNG(pixmap, tempbank)
tempstream.WriteInt(tempbank.Size())
WriteBank(tempbank, tempstream, 0, tempbank.Size())
Next
SaveBank(iconbank, "testfile")
zip.OpenZip("test.zip", True)
'add the stream and file to the zip
zip.AddStream(tempstream, "teststream")
zip.AddFile("testfile")
zip.CloseZip()
End
This should create a zip with 2 file in it, but the zip is empty... But I'm not sure if this is normal behaviour
Thanks!