decompress
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
decompress
Anyone know of an example using the decompress function to extract data from a gzip file? Looked at the examples in the docs and I just can't get it to work.
Dear Andycal,
You can read the data from a file in the oldfashioned way:
or use the url form:
Best,
Mark
You can read the data from a file in the oldfashioned way:
Code: Select all
put "~/desktop/file.gz" into myFile
open file myFile for binary read
read from file myFile until EOF
close file myFile
put decompress(it) into myData
Code: Select all
put "~/desktop/file.gz" into myFile
put decompress(URL ("binfile:" & myFile)) into myData
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Dear Andycal,
The variable myData only contains the result of the decompress() function. It contains data. If you want these data to be written back to disk, you have to use the write command or use the put url command.
Best,
Mark
The variable myData only contains the result of the decompress() function. It contains data. If you want these data to be written back to disk, you have to use the write command or use the put url command.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode