Where to store application data?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Where to store application data?
I have a Win/Mac standalone, which stores its configuration data in a file. In Windows, I can put it in $APPDATA under a company name subfolder. What's the equivalent on OS X?
Ciao,
Paul
Paul
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Where to store application data?
specialFolderPath("asup") will get you to the OS X Application Support folder.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Where to store application data?
Thanks. Unfortunately, I don't have a Mac handy, as I do all my development on Windows. Is it customary for each software vendor to create a subfolder under that folder, with the same name as the company, and then put its stuff inside that? Are blanks in the folder names usually avoided? I'd just like to get an idea of customary or best practices.
Ciao,
Paul
Paul
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Where to store application data?
Judging from the folders on my drive is seems the most common convention is to name the folder the same as the app, regardless of whether or not that name contains white space.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Where to store application data?
Hi,
If i have understand (i don't speak really english9
I work with Mac but this script work also in a window standalone.
I use this script to read and write data in a folder "LeNecessaire" in the same folder of
the standalone.
I hope this help
Jean-Marc
If i have understand (i don't speak really english9
I work with Mac but this script work also in a window standalone.
I use this script to read and write data in a folder "LeNecessaire" in the same folder of
the standalone.
Code: Select all
on FaitPathNec
global gPathNec
put the filename of this stack into bufPath
put bufPath into gPathNec
put the environment into pEnv
put the itemdel into OID
set the itemdel to "/"
put the num of items of gPathNec into nbF
if the platform = "MacOS" then
if pEnv = "standalone application" then
delete item (nbF-3) to nbf of gPathNec
end if
if pEnv = "development" then
delete last item of gPathNec
end if
else
delete last item of gPathNec --•• standalone window
end if
set the itemdel to OID
put "/"&"LeNecessaire" after gPathNec
end FaitPathNec
Jean-Marc
https://alternatic.ch
Re: Where to store application data?
The problem with putting things there is that Win Vista and Win7 prevent you from writing to data files in the Programs tree. That's why you now have to put things into the application data part of the tree.
By the way, for what you want to do, you can generate the pathnames more simply just by appending "/../LeNecessaire" or "/../../../LeNecessaire".
By the way, for what you want to do, you can generate the pathnames more simply just by appending "/../LeNecessaire" or "/../../../LeNecessaire".
Ciao,
Paul
Paul
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Where to store application data?
specialFolderPath(26) will get you the path to the current user's Application Data folder on Win XP, Vista, and 7.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Where to store application data?
Here is some useful information:
http://developer.apple.com/mac/library/ ... 1-BAJHCHJI
-- and --
http://developer.apple.com/mac/library/ ... 002722-TP6
And, a Note from that page:
redpill
http://developer.apple.com/mac/library/ ... 1-BAJHCHJI
-- and --
http://developer.apple.com/mac/library/ ... 002722-TP6
And, a Note from that page:
Regards,Note: If you install additional files when your application is first run, be sure to install them in obvious places, such as in the Application Support directory. Place your resources in a directory named for your application to make it easy for the user to find these files if they ever need to uninstall your application.
redpill