Where to install database for it to be writeable?

I’m running into a problem when I install my app on linux with a .deb package.
I have tried to install app to folders like /urs/bin and /opt/myapp/ which works, but my application can only read from the database, not write to it, unless I manually chmod the db.rsd

Where and how do prepare the install so the database is writeable for the user without chmod’ing
I have looked online, but I can’t find a good answer to this question.

Look at SpecialFolder.ApplicationData.

Thanks… I’m trying the /home/UserName/ but how do I specify the UserName which is not given?

http://documentation.xojo.com/index.php/SpecialFolder
As Bob said, on Linux SpecialFolder.ApplicationData points to /home/UserName/.

Use the functions provided by the SpecialFolder module and don’t try to craft the path yourself.

See:

http://documentation.xojo.com/index.php/SpecialFolder

So SpecialFolder.Documents will give you a FolderItem that already points to the right place.

(D’OH, Jason beat me to it!)

Great I got it.

My Q2 is since I use a .deb package creator “Debreate” (if anyone should know it) , when I specify the installation path to the specialfolder for the database what is the syntax?

It should be /home/Username/appname/db.rsd but I have trouble with the UserName part of the path.

I don’t know if you have an option there, but I’d have the app copy the database to the right folder on startup if it’s not there already.

That’s a valid option. Thanks Kem. I’m gonna try that out.

Isn’t the usual Linux tilde ‘~/appname/db.rsd’ an option? Or doesn’t this deb-creating software accepts such path names?

you can always use SpecialFolder.UserHome and create a folder there.
If name starts with . it will be invisible.

Is it to create an database in your own Xojo-application or to access the right folder in your deb-creating software?

It is not in the original question per se, but it will be a good idea to place a paragraph description about where to place the database (for SQLite as an example) SQLiteDatabase.CreateDataBaseFile or SQLiteDatabase.

So, we will not have to ask the question here. This makes sense.