problems decompressing files
Dar Scott
dsc at swcp.com
Fri Sep 12 11:56:00 EDT 2003
Here are some things that have come to my mind that might help in
workarounds.
1.
Create a compression function that uses the training string I
discovered. As far as I know, this only increases the chance that
decompression will not have an error. It also creates a compression
you can't share with other apps. It increases size, so it might not be
suitable for small values.
2.
Create a compression function that tests whether compress() or #1 above
will generate an error when decompressed. Use try/catch. This will
only work on a system with the bug.
3.
Create a compression function that creates a trivial gzip format of
uncompressed data. This can be done on any platform and the result can
be used by other apps or future apps, but is not really compressed.
4.
Create a custom compression that uses #1 or compress() and #2 to test
(so only works in bug environment) that creates a non-standard
compression.
5.
Create a function that returns true/false whether the bug is present.
Use that to decide what strategy to use.
6.
Create a function that says whether a value is gzip or not. This
should test the signature and a couple flags and not rely on
decompress() failure.
I have few suggestions for handling compressed files from other
sources, except #2 above and these:
7.
Create a handler/function that provides some info about a gzip image,
that is, the file that cannot be decompressed. This might pull out
some header info. Three flags of the deflate info might be easy to
grab, also.
8.
Create a decompress that uses shell(). This can be used with try/catch
that tries the internal method first. The shell need only work on OS X.
Dar Scott
More information about the use-livecode
mailing list