Inflating ZIP Deflated data string
Posted: Fri Jun 14, 2013 9:36 pm
Hi Folks,
I asked this a little while back and was referred to the revZip functions, however after reviewing the documentation (there does not appear to be much beyond what is in the dictionary) and playing with the functions I'm not sure this is the way to go. The revZip functions seem to only work with file based zip archives, my data is in a buffer read from a network socket, and has been zip deflated by the server I get it from. I did try writing the following with my data:
put "/my/path/to/archive.zip" into tArchive
revZipOpenArchive tArchive, "write"
revZipAddUncompressedItemWithData tArchive, "myZippedItem", "thePayload"
revZipCloseArchive tArchive
revZipOpenArchive tArchive, "read"
revZipExtractItemToVariable tArchive, "myZippedItem", "tDeflated"
However it's still compressed after extracting to tDeflated. If anyone has experience using these functions, I could sure use some help. It is hard to believe that there is no interface beyond revZip to the libzip library. I am trying to translate a perl script to LiveCode and give it a GUI. This whole deflate business takes one line in the perl script, using their Compress::Zlib interface.
I did stumble across a site on github where there perhaps appears to be some integration work being done by RunRevMark at: https://github.com/runrev/livecode-thir ... ter/libzip, If anyone knows more about this I would really like to know if there are any plans to extend the LiveCode interface to the libzip library.
If I am unable to figure out how to inflate this network read data it may be a deal killer and my boss will have me using Adobe Air or something. Any help would be greatly appreciated.
Thanks,
Daryl
I asked this a little while back and was referred to the revZip functions, however after reviewing the documentation (there does not appear to be much beyond what is in the dictionary) and playing with the functions I'm not sure this is the way to go. The revZip functions seem to only work with file based zip archives, my data is in a buffer read from a network socket, and has been zip deflated by the server I get it from. I did try writing the following with my data:
put "/my/path/to/archive.zip" into tArchive
revZipOpenArchive tArchive, "write"
revZipAddUncompressedItemWithData tArchive, "myZippedItem", "thePayload"
revZipCloseArchive tArchive
revZipOpenArchive tArchive, "read"
revZipExtractItemToVariable tArchive, "myZippedItem", "tDeflated"
However it's still compressed after extracting to tDeflated. If anyone has experience using these functions, I could sure use some help. It is hard to believe that there is no interface beyond revZip to the libzip library. I am trying to translate a perl script to LiveCode and give it a GUI. This whole deflate business takes one line in the perl script, using their Compress::Zlib interface.
I did stumble across a site on github where there perhaps appears to be some integration work being done by RunRevMark at: https://github.com/runrev/livecode-thir ... ter/libzip, If anyone knows more about this I would really like to know if there are any plans to extend the LiveCode interface to the libzip library.
If I am unable to figure out how to inflate this network read data it may be a deal killer and my boss will have me using Adobe Air or something. Any help would be greatly appreciated.
Thanks,
Daryl