Accessing user's resource files?


Gruntfuggly

Mostly Harmless
Joined
Feb 2, 2004
Messages
1,487
Location
Brighton, UK
Website
www.zaonce.com
I've got an app which normally reads a resource file from the users home folder.

Whats the best way to do this from a PND? I've had a look at the wiki, but it's quite confusing. I understand that it's best not to write to NAND, so shouldn't access the home folder directly - I should export $HOME to somewhere else. But if I move it into the PND, how can the user update it?

Any advice much appreciated!
 
Use the appdata directory:


/media/SDCARD/pandora/appdata/PNDNAME/

Anything the user copies to that directory will be mirrored into the mount location of the PND.

Something like this:


/media/SDCARD/pandora/appdata/PNDNAME/resource/ ---> /mnt/utmp/PNDNAME/resource/

So now the application can access stuff in the resource dir just like it accesses any other dir from PND (the contents of the PND are also at /mnt/utmp/PNDNAME/ while it is running).
 
Last edited by a moderator:
The PND's appdata folder is generally used in place of $HOME. The appdata folder gets union mounted with the PND so design stuff to have its resources in the root of the PND, and users can add to that and update it by putting stuff directly in their appdata folder. I forget some of the technical details - the variable $PNDHOME springs to mind.
 
Thanks chaps - I thought the appdata folder would be created automatically, but it seems to only get created when you put something in it. 

Sorted now!  B)
 
Back
Top