Need help with storing dot files

Alexander Larsson alexl at redhat.com
Fri Oct 26 11:05:56 UTC 2018


On Fri, Oct 26, 2018 at 12:59 PM Daniel Kasak <d.j.kasak.dk at gmail.com> wrote:
> On Fri, Oct 26, 2018 at 5:37 PM Alexander Larsson <alexl at redhat.com> wrote:
>> > Is there a way to make ~/.odbcinst.ini persist? I'm not sure if I can make unixODBC read from other locations - and it's flaky enough as it is.
>>
>> This sounds weird. There should be nothing special about
>> ~/.odbcinst.ini. What file access are you giving your flatpak?
>> --filesystem=home?
>>
>
> Hi, and thanks for the response. I don't currently expose the filesystem. I would like to - so users can load SQL files via a browser for example - but this also complicates things like the .odbcinst.ini file, which would not be valid for the application as it would point to libs that aren't usable. What happens under this circumstance ( ie when I don't use --filesystem=home )? As I mentioned, my app's config ( which lives in a dot folder ) is persisted. Maybe dot files are not persisted, but dot folders are?

Generally, if you don't give any access to the filesystem, the *only*
directory that persists is ~/.var/app/$appid/. However, various
XDG_*_DIR env vars are set which means most software redirects its
saves there. There is a --persist= permission which allows you to
specify another directory in $home to be persisted (it becomes a
bind-mount into a directory in ~/.var/app/$appid/). However, I'm not
sure how well that will work with individual files rather than
directories. Especially ones that don't already exist. You might want
to try it out.

Another approach would be to patch the app to store the config in
$XDG_CONFIG_HOME instead of $HOME. That will make it automatically
work, and is more "modern" anyway.



-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                Red Hat, Inc
       alexl at redhat.com         alexander.larsson at gmail.com


More information about the Flatpak mailing list