Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best directory to store application data with read\write rights for all users?

Until Windows Vista I saved my application data into the directory where the program was located. The most common place was "C:\Program Files\MyApplication". As we know, under Vista and later the common user does't have rights to write under "Program Files" folder. So my first idea was to save the application data under the "All Users\Application Data" folder. But it seems that this folder has writing restrictions too!

So to sum up, my requirements are:

  • The folder should exist under Windows XP and above.
  • All users of the system should have read\write\creation rights to this folder and its subfolders and files.
  • I want to have only one copy of file\files for all users.
like image 534
Wodzu Avatar asked Apr 10 '10 18:04

Wodzu


People also ask

Where should I store application data in Linux?

Your home directory is the only place where you can store files permanently. Applications typically store their configuration and automatically saved data in a file or directory called . application-name in your home directory. (Some applications save in groups, e.g., ~/.

How do I set permissions to all files in a directory?

To change directory permissions for everyone, use “u” for users, “g” for group, “o” for others, and “ugo” or “a” (for all). chmod ugo+rwx foldername to give read, write, and execute to everyone. chmod a=r foldername to give only read permission for everyone.

Who has all the permissions read/write and execute?

Some file permission examples: 777 - all can read/write/execute (full access). 755 - owner can read/write/execute, group/others can read/execute. 644 - owner can read/write, group/others can read only.


2 Answers

It's often good to use environment variables so you keep things more generic.

Vista has changed some things, with NTFS Junction Points. See http://www.svrops.com/svrops/articles/jpoints.htm

Anyway, using %appdata% should automagically put files in the proper place on xp/vista/7

like image 185
rkulla Avatar answered Sep 28 '22 18:09

rkulla


There is no such location. Even on Windows XP (and probably 2000 as well) no such location ever existed; we just think it did because we all ran with administrative privileges. It is not until Vista forces us to run as limited user that we realize our incorrect assumptions. You're going to have to explicitly set the permissions on your directory.

like image 35
Luke Avatar answered Sep 28 '22 18:09

Luke