Hello Guys, I have no idea how to extract files from a zip file that I've successfully downloaded with urlLoader. Can someone help to put me on the right track? tanks Mat
After a quick analys i discovered that this library using bit32 operations whihc is supported in Lua 5.2 . I am not sure which version of Lua Gideros is using, but it seems the problem with this Lua library. Better try another one.
Anyhoo find attached an example using the aforementioned zzlib.lua working with a zip file..
The example will run but the crc check fails, hence the error message. This seems odd however because the output is exactly as you would expect.. namely the text inside the hello.txt file.
Right.. just ignore that example from above. I made a better one which has code to...
1. Unzip a named file from within a named zip file 2. Unzip all files from a named zip file to the apps documents folder. 3. List all files contained in a named zip file.
Comments
https://github.com/zerkman/zzlib
Never tried it just found it from here;
http://lua-users.org/wiki/CompressionAndArchiving
Likes: antix
i've download zzlib.lua but give me an error when i
gave a try after added as file to my project.
Does anyone know if this can be used?
thank you
However it is not a pure Lua based solution. There seems to be a pure Lua based one here..
https://github.com/davidm/lua-compress-deflateluaScratch that, it only works with gzip
Anyhoo find attached an example using the aforementioned zzlib.lua working with a zip file..
The example will run but the crc check fails, hence the error message. This seems odd however because the output is exactly as you would expect.. namely the text inside the hello.txt file.
This should be enough to get you going @mitto
The zzlib.lua code could be expanded to unzip every file contained within the zip file to the apps documents folder as well.
1. Unzip a named file from within a named zip file
2. Unzip all files from a named zip file to the apps documents folder.
3. List all files contained in a named zip file.
Let us know if you have trouble with that
Likes: pie, hgy29
I try this one because is all Lua.
Likes: antix