ZipEngine & directories
BlitzMax Forums/BlitzMax Programming/ZipEngine & directories
| ||
Is there not a way to save a file to a .zip with folder structure, using zipengine? I know how to read a file from a zip with a file structure (zrObj.ExtractFileToDisk("cfg/text/text.txt" ....), but if I were to call ZIPWRITEOBJECT.AddFile("testing\files\text.txt"), it would be looking for a file in CurrentDirectory + "testing\files\text.txt", which is ovbiously not what I would like to do. |
| ||
Looks like the whole zip writing thing doesn't even work, saving a simple text file to an empty existing .zip, then trying to load that same .zip in winrar shows an unexpected end of archive from diagnostics.. Heres an example.. (create data.txt and type in some gibberish) Local zwObject:ZipWriter = New ZipWriter 'Also tested with data.zip existing and not existing If zwObject.OpenZip("data.zip", True) Then ' Even changing the append param to True doesn't work zwObject.AddFile("data.txt") Else Throw "data.zip was not found or did not load correctly." End If |
| ||
Are you using Gman's Zipmodule 2.0? Have you tried using "/" instead of "\" for the path structure? |
| ||
Yep, version 2.06.. And yes I have tried using both slashes, same results for each test. |
| ||
Dig out a complete! example code and ask Gman for help. You could do so via E-Mail or forums: http://www.gprogs.com/forum/viewforum.php?id=8 |
| ||
greetings :) i know you mentioned you tried it this way, but i can only replicate if the zip doesnt exist and True is passed into OpenZip(). in order for the zipengine to automatically create a file OpenZip() needs False as the append parameter. i did try opening an existing zip created with IZArc and it successfully ran, but only after it already had at least one file in it. i would assume it needs the proper zip headers written to the file in order to function in append mode. have you tried running the available sample? in the course of the sample it does exactly what you are trying. if you havent done it already i think this is the first step. also, have you tried rebuilding the mod? |