Reply
Thread Tools
Guest | Posts: n/a | Thanked: 0 times | Joined on
#1
Today's Code177 asks Noobish development questions question is:

What are the conventions for storing application data?

For example, say I have an application and I wish to store two types of data:
  • Image Cache data
  • Meta data (xml, etc)
Where would I store these? I'm not sure there is a difference beyond perhaps child directory structure (/cache vs /metadata), but in terms of actual system filepath I have no idea.

So - configuration data - where does it go?

Additionally, are there any permissions concerns that must be overcome in order to do this?

Thanks!
 

The Following User Says Thank You to For This Useful Post:
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#2
Interesting question I think.

Up so far, I've been using "pseudostandard" ~/apps/<app name> dir, but I think it was just a camera app invention and nothing really standardized.

For "user-hidden" data, I'd say you better follow XDG Base Directory spec (as on Linux desktop): http://standards.freedesktop.org/bas...ec-latest.html
Basically, ~/.local/share for "big data files", ~/.config for config files, and ~/.cache for "stuff that doesn't make things go amiss when deleted", like, well, cache files, thumbnails, etc..

As for user visible data, the adequate MyDocs folder.
 

The Following 2 Users Say Thank You to javispedro For This Useful Post:
Guest | Posts: n/a | Thanked: 0 times | Joined on
#3
Excellent information!

So would it be correct to assume that the app will have sufficient privileges to create/destroy new files and directories within the above directories?
 
Posts: 452 | Thanked: 522 times | Joined on Nov 2007
#4
Originally Posted by code177 View Post
Excellent information!

So would it be correct to assume that the app will have sufficient privileges to create/destroy new files and directories within the above directories?
Afaik, the apps should have full access to everything in the home directory since you are running as that use.

Depending on what you are doing and if you need it backed up you can either use;
~/.yourapp
or
~/MyDocs/YourApp

The "." makes the directory hidden. I believe the stuff in ~/MyDocs is backed up in a SSU update.

Nathan

Last edited by Nathan; 2009-10-19 at 20:52. Reason: on = in
 

The Following User Says Thank You to Nathan For This Useful Post:
Guest | Posts: n/a | Thanked: 0 times | Joined on
#5
Awesome! thanks guys
 
qgil's Avatar
Posts: 3,105 | Thanked: 11,088 times | Joined on Jul 2007 @ Mountain View (CA, USA)
#6
 

The Following 4 Users Say Thank You to qgil For This Useful Post:
Reply

Tags
data storage, development, maemo 5, python, saving files


 
Forum Jump


All times are GMT. The time now is 04:57.