Inflating ZIP Deflated data string

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
daryl
Posts: 47
Joined: Mon Apr 29, 2013 11:43 pm

Inflating ZIP Deflated data string

Post by daryl » 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

Tribblehunter
Posts: 78
Joined: Wed Apr 10, 2013 9:08 pm

Re: Inflating ZIP Deflated data string

Post by Tribblehunter » Mon Feb 02, 2015 7:15 am

Did anyone get anywhere with this? I am having the same problem.
Returning to try to learn livecode again.

But much greyer at the temples than the last time.

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Inflating ZIP Deflated data string

Post by MaxV » Thu Feb 05, 2015 5:21 pm

Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Tribblehunter
Posts: 78
Joined: Wed Apr 10, 2013 9:08 pm

Re: Inflating ZIP Deflated data string

Post by Tribblehunter » Thu Feb 05, 2015 10:12 pm

Managed to get my problem sorted.

Was not a zip problem. Just needed to decompress file.

Code: Select all

put decompress (it) into tHtmlpage
in this thread. http://forums.livecode.com/viewtopic.php?f=7&t=16602
Returning to try to learn livecode again.

But much greyer at the temples than the last time.

Post Reply