Best location for 'shared' files on Mac
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Best location for 'shared' files on Mac
Hi,
We have an application that has a sqllite common database, and a few text files we would like all the users on the mac to be able to access.
If we put them in a users documents folder, then they are not available to the other users and each user ends up creating their own database, and if we put them in a folder in the application package location we get permission errors for the other users.
Any ideas where would be the best location to put the files so all users can access the files, and the best code to get the path to that location.
Thanks!
Andy
We have an application that has a sqllite common database, and a few text files we would like all the users on the mac to be able to access.
If we put them in a users documents folder, then they are not available to the other users and each user ends up creating their own database, and if we put them in a folder in the application package location we get permission errors for the other users.
Any ideas where would be the best location to put the files so all users can access the files, and the best code to get the path to that location.
Thanks!
Andy
Hi andy,
try:
put specialfolderpath("asup")
-> /Library/Application Support
You may create a subfolder there, so this might be the right place for you
Best from germany
Klaus
P.S.
Please check the Rev docs for "specialfolderpath" and especailly the link to the Apple docs (scroll down a bit to see the URL), to get a list of Mac only 4 character "folderidentifiers" to play with.
try:
put specialfolderpath("asup")
-> /Library/Application Support
You may create a subfolder there, so this might be the right place for you
Best from germany
Klaus
P.S.
Please check the Rev docs for "specialfolderpath" and especailly the link to the Apple docs (scroll down a bit to see the URL), to get a list of Mac only 4 character "folderidentifiers" to play with.
-
- VIP Livecode Opensource Backer
- Posts: 4000
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Hi,
you might also consider
the shared user folder
put specialfolderpath("sdat")
it is accessible for all users. No access problems here but also accessible to every user via the finder. I use it for multi user access.
/Library/Application Support" sounds interesting, is it accessible for every user? is it OK to store data there?, special considerations regarding back up?
cheers
bernd
you might also consider
the shared user folder
put specialfolderpath("sdat")
it is accessible for all users. No access problems here but also accessible to every user via the finder. I use it for multi user access.
/Library/Application Support" sounds interesting, is it accessible for every user? is it OK to store data there?, special considerations regarding back up?
cheers
bernd
Hi Bernd,
alles im Lot?
What exactly do you mean with "special considerations regarding back up"?
alles im Lot?
I'm not sure, cannot test it here at work.bn wrote:...
/Library/Application Support" sounds interesting, is it accessible for every user? is it OK to store data there?, special considerations regarding back up?
What exactly do you mean with "special considerations regarding back up"?
Hi all,
after some tests it looks like:
is the place to store stuff, since ALL users can read and write here.
after some tests it looks like:
Code: Select all
specialfolderpath("sdat")
-
- VIP Livecode Opensource Backer
- Posts: 4000
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Hi Klaus,
allet paletti
Well, regarding backup I meant that I often just backup the users folder, since that is what changes most, and the rest just occasionally, which, I know, I know, it is bad practice, just something to take into consideration when one is not in control of the machine/environment.
all the best to Germany from Germany
bernd
allet paletti
Well, regarding backup I meant that I often just backup the users folder, since that is what changes most, and the rest just occasionally, which, I know, I know, it is bad practice, just something to take into consideration when one is not in control of the machine/environment.
all the best to Germany from Germany
bernd
Just following on.
Ive tried both the sdat and asup options, with interesting effects, not what I had wanted or expected from a shared area.
The main user can read and write to the files in either folder using the sqllite revdb stuff, but the other users still can't, it generates a RevExternalLibrary exception.
Other apps in the second user can read the files just fine which shows the files are readable, just not sure with my app with Runrev wont read them.
Any ideas?
Andy
Ive tried both the sdat and asup options, with interesting effects, not what I had wanted or expected from a shared area.
The main user can read and write to the files in either folder using the sqllite revdb stuff, but the other users still can't, it generates a RevExternalLibrary exception.
Other apps in the second user can read the files just fine which shows the files are readable, just not sure with my app with Runrev wont read them.
Any ideas?
Andy
-
- VIP Livecode Opensource Backer
- Posts: 4000
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
andy,
look at the permissions of the db file using either the info (activate the file then command-i) or use the terminal. Maybe Rev sets the permissions to the main user and lets others read. Try to change the permissions so everyone can read and write, check the permissions for the shared folder also. Just a guess since I never used a db in the shared folder.
regards
bernd
look at the permissions of the db file using either the info (activate the file then command-i) or use the terminal. Maybe Rev sets the permissions to the main user and lets others read. Try to change the permissions so everyone can read and write, check the permissions for the shared folder also. Just a guess since I never used a db in the shared folder.
regards
bernd
I think you have hit the nail on the head bernd.
The file has read/write permission for the first user, and just read for the other users.
So, the next question is does anyone know how a simple way to change the permissions on a specific file or folder so all users can access it with read/write permissions.
Ideally Id just run a command / subroutine on that folder to change all files to read/write by all, they are not 'private' files.
Thanks
Andy
The file has read/write permission for the first user, and just read for the other users.
So, the next question is does anyone know how a simple way to change the permissions on a specific file or folder so all users can access it with read/write permissions.
Ideally Id just run a command / subroutine on that folder to change all files to read/write by all, they are not 'private' files.
Thanks
Andy
-
- VIP Livecode Opensource Backer
- Posts: 4000
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Andy,
if it is a one time job it is easy. You have to have administrator rights to change permissions. If you have physical access to the machine, go to the files in the finder, get Info and change the permissions to what you want. It will ask for an administrator password. And that should be it. Rev is probably not going to change the rights back if it writes to the files.
If you want to deploy the app, you could go with either an applescript or a shell command. both need the administator password. With applescript I could help you, with the shell script it would be worth to search the list. Gmaine or Nabble. It is a common problem. There should be shell commands you can issue from Revolution for that. Or someone in this forum can chime in and shed some light/script on this matter...
regards
Bernd
if it is a one time job it is easy. You have to have administrator rights to change permissions. If you have physical access to the machine, go to the files in the finder, get Info and change the permissions to what you want. It will ask for an administrator password. And that should be it. Rev is probably not going to change the rights back if it writes to the files.
If you want to deploy the app, you could go with either an applescript or a shell command. both need the administator password. With applescript I could help you, with the shell script it would be worth to search the list. Gmaine or Nabble. It is a common problem. There should be shell commands you can issue from Revolution for that. Or someone in this forum can chime in and shed some light/script on this matter...
regards
Bernd
Thanks again.
The command...
seemed to work just fine as long as the user creating the files in the first place is an administrator.
If the user is a 'standard' user, they cant even create a file in the asup area in the first place, so I cant chmod it unless its created.
I think I might just stick with what I have - the files in the users documents folder, that works, just doesnt share the data between users.
Thanks again for trying!
Andy
The command...
Code: Select all
if the platform is "MacOS" then
get shell("chmod 777" && quote & tFilePath & quote)
end if
If the user is a 'standard' user, they cant even create a file in the asup area in the first place, so I cant chmod it unless its created.
I think I might just stick with what I have - the files in the users documents folder, that works, just doesnt share the data between users.
Thanks again for trying!
Andy