getting into the url cache
Richard Gaskin
ambassador at fourthworld.com
Thu Dec 12 21:02:00 EST 2002
Dave Cragg wrote:
> I use this technique a lot so don't give up. Monte's point about
> using compress on the "binfile" when making the compressed file may
> be significant.
These are coming over the 'Net, and it seems the "go url" command faithfully
transfers binary files as such -- thanks to you and Mpnte, I found the
limple logic error ib my script and now it works great.
Thanks! Hopefully the lil' toy I'm making with this wil be useful for you
folks as well....
>> The "go stack" command takes a stack descriptor rather than stack data, so
>> it would seem your example is expecting MC to treat the decompressed stack
>> data as a stack descriptor, no?
>
> I thought the same until I started messing around one day.
Monte's explanation made it clear for me: even a stack descriptor
ultimately becomes evaluated to stack data. Just when you think you've
learned everything about a language there's always another few thousand
things to learn. :)
> Another trick is to set a custom property to a compressed stack file. E.g.
>
> set the cMagicStack of this stack to compress(url
> ("binfile:path/to/file.mc"))
>
> Then do this:
>
> go stack decompress(the cMagicStack of this stack)
>
> I've never used this for anything practical, but I've often wondered
> about employing this technique as a way of creating configuration
> palettes for distributable widgets that you create as a group of
> objects. Normally you would use a substack as a palette, but you
> can't copy substacks with groups.
>
> For example, you might make some kind of table object as a group of
> fields and buttons. And you've made it in a way that you can
> configure various settings, for example, the number of columns or
> rows. You might do this with some setprop handlers in the group. Then
> you want to copy the object into various other stacks. But you want
> to be able to configure the settings of these copies with a visual
> interface instead of relying on scripting. So you create a stack that
> lets you set the configurable options for the widget (rows, columns,
> whatever) and put the stack inside a custom property of the group.
> You also provide a means in the group (option-clicking for example)
> to open this "magic window". Feasible?
I would imagine so.
Ever since MC added gzip support I've been a happy boy, with the limitation
that gzip files contain only one file and lose the Mac meta data.
But enamored as I am of using custom props as carriers for binary daa, I've
been working on a simple tool to compress a folder's contents into gzipped
customm props in a stack file, with Mac meta data preserved on
decompression. Time permitting I'll have that done in a couple weeks after
I clear some more urgent projects off my plate.
In the meantime I wrote a very simple utility for gzipping and un-gzipping
single files, with the mdest benefit of having the Mac filetype set
appropriately if the decompressed file ends with ".mc" or ".rev". I just
uploaded it to the RunRev user contributions page -- hopefully it will
appear there soon.
--
Richard Gaskin
Fourth World Media Corporation
Developer of WebMerge 2.1: Publish any database on any site
___________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
Tel: 323-225-3717 AIM: FourthWorldInc
More information about the metacard
mailing list