Arrays and Custom Props

Richard Gaskin ambassador at fourthworld.com
Mon Feb 16 14:55:45 EST 2009


Bob Sneidar wrote:
> Oh gotcha! So you are saying that the properties are something that is  
> a part of the executable inside the package? How odd.

The confusion stems from OS X lying to us:  it tells us that an 
application is a file, when it's really a folder.  :)

The actual executable (the runtime engine bound to your stack) is inside 
that folder in /Contents/MacOS/.  That executable is essentially the 
same as you get on Win and Linux, except that on OS X it's buried inside 
of these other folders comprising the "bundle".  This executable cannot 
modify itself at runtime, and I don't believe any of the supported OSes 
allow any executable to modify themselves.

But as you've found, just about any data file be modified, including 
those stored in the bundle (with appropriate permissions).

While it's possible to write data into the bundle, the OS X HIG suggests 
using the Application Support folder or Preferences for that.  The 
equivalent to Application Support in Win is Application Data.  You can 
get the paths to these using Rev's specialFolderPath function:

-- OS X: Application Support
  get specialFolderPath("asup")

-- OS X: Preferences:
  get specialFolderPath("preferences")

-- Win: Application Data:
   get specialFolderPath(26)

For a complete list of constants for special folders on OS X and Win:
<http://sonsothunder.com/devres/revolution/tips/file010.htm>

As Paul noted, one advantage to storing your user's data outside of the 
bundle is that they can upgrade the application without losing their data.

--
  Richard Gaskin
  Fourth World
  Revolution training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com



More information about the use-livecode mailing list