gzip & Mac File Types

Richard Gaskin ambassador at fourthworld.com
Sun Sep 15 18:12:02 EDT 2002


Rob Cozens wrote:

>> As long as you're using a custom format why not use a stackfile as the
>> carrier, with the data from indivdual files tucked away in custom
>> properties?
> 
> I hate to show my ignorance; but I'm not understanding the advantages
> of this approach.  All I want is a utility that can
> compress/decompress individual text files & stacks across all
> platforms supported by RunRev...though I'm adding support for Mac
> files with resource forks for completeness.  I don't see editing as
> coming into play here.

Any multi-part format must be parsed.  Your code must read the file's data,
Finder info, and res fork, and store these in a way that allows the tool to
piece them out again later as needed.

It's simple enough to use a text file for this, but just a tad simpler to
use a stack file.  Compare whatever parsing routines you were going to write
with the simple, robust, and ultra-fast one-liner syntax of getting a custom
property.

And expanding the notion to work with multiple files becomes even more
convenient with Rev's array notation.

In fact, if you later find you need to add any other info at all (such as
directives on what to do with the uncompressed files -- run them in an app,
leave 'em be, etc.) you can just add another property or property array to
the stack file, and you never need to worry about breaking your format.

With a text file you also have the potential risk that whatever delimiters
you use may appear in data.  With Rev's ability to store binary data in
custom properties you never need to think about how it's delimited.

For more on using stack files for data storage, see:

<http://lists.runrev.com/pipermail/use-revolution/2002-July/006141.html>

There's more info in that post than you'll need, but hopefully it'll tickle
your imagination about the robustness and ease of using stack files for data
storage.

-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Custom Software and Web Development for All Major Platforms
 Developer of WebMerge 2.0: Publish any database on any site
 ___________________________________________________________
 Ambassador at FourthWorld.com       http://www.FourthWorld.com
 Tel: 323-225-3717                       AIM: FourthWorldInc




More information about the use-livecode mailing list