storing a stack as a customprop

Ron runrevron at gmail.com
Wed Dec 9 02:55:18 EST 2009


As a follow up to this -
I am storing my prefs  in a stack that starts as a custprop and is  
spit out  when the application starts. The resulting stack is  
referenced throughout the application and data saved to it. It is not  
outputted each time the app starts (unless the user deletes the file),  
but it is written to and saved each time a preference is changed. When  
a stack is included in the standalone build there is an option to  
encrypt the stack.

However, the file that results (is outputted?) from the method above  
is readable by any text editor. Is there a way to encrypt this stack  
created from a custprop?

Thanks for your help,
Ron


BTW another approach to the problem below is to two step it:

put "binfile:" & filepath into filepath
set the storedStack of stack "updateList" to URL filepath

On Oct 18, 2009, at 10:17 AM, Richard Gaskin wrote:

> Peter wrote:
>
> > set the storedStack of stack "updateList" to URL "binfile:" &  
> filepath
>
> Looks like Mark caught it.  Without the parentheses, the engine  
> interprets the above as:
>
> 1. get url "binfile:"
> 2. append that data with filepath
> 3. store it in the specified property
>
> But with parens it first concatenates the "binfile:" and filepath  
> into a single string that's then used as the source for the URL.
>
> All I can add to Mark's excellent sleuthing is some extra credit:
>
> You can save about 30% or more on average by compressing the data  
> before storing it:
>
> set the storedStack of stack "updatelist" to \
>   compress( url ("binfile:" & filePath) )
>
> To spit it back out just reverse the order of the operations:
>
> put decompress( the storedStack of stack "updatelist" \
>    unto url ("binile:" & someNewPath)
>
>
> --
> Richard Gaskin





More information about the Use-livecode mailing list