maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Conventions for Application Data storage (https://talk.maemo.org/showthread.php?t=33108)

code177 2009-10-19 16:28

Conventions for Application Data storage
 
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!

javispedro 2009-10-19 16:34

Re: Conventions for Application Data storage
 
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.

code177 2009-10-19 16:37

Re: Conventions for Application Data storage
 
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?

Nathan 2009-10-19 16:40

Re: Conventions for Application Data storage
 
Quote:

Originally Posted by code177 (Post 351415)
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

code177 2009-10-19 16:41

Re: Conventions for Application Data storage
 
Awesome! thanks guys :)

qgil 2009-10-19 19:16

Re: Conventions for Application Data storage
 
Please keep also in mind http://wiki.maemo.org/Documentation/...opt_and_MyDocs


All times are GMT. The time now is 10:01.

vBulletin® Version 3.8.8