"How do applications know where to save data to? They write to a well
known directory under XDG_{CACHE,CONFIG,DATA}_HOME, so use that. Count
the logs and other stuff (if that actually does happen) as in use by the
system if it's too hard to do it any other way.
Applications will always have read access to their install directory
and have write access to directories they own as determined by the XDG
base directory specification. Specifically:
XDG_CACHE_HOME/<APP_PKGNAME>, XDG_RUNTIME_DIR/<APP_PKGNAME>,
XDG_RUNTIME_DIR/confined/<APP_PKGNAME> (for TMPDIR),
XDG_DATA_HOME/<APP_PKGNAME> and XDG_CONFIG_HOME/<APP_PKGNAME>. Apps
can discover these paths using standard APIs and appending the package
name as defined by the 'name' field of the manifest."
Comment from https:/ /code.launchpad .net/~ken- vandine/ ubuntu- system- settings/ lp1524424/ +merge/ 280196
"How do applications know where to save data to? They write to a well CONFIG, DATA}_HOME, so use that. Count
known directory under XDG_{CACHE,
the logs and other stuff (if that actually does happen) as in use by the
system if it's too hard to do it any other way.
From https:/ /wiki.ubuntu. com/SecurityTea m/Specification s/ApplicationCo nfinement:
Applications will always have read access to their install directory HOME/<APP_ PKGNAME> , XDG_RUNTIME_ DIR/<APP_ PKGNAME> , DIR/confined/ <APP_PKGNAME> (for TMPDIR), HOME/<APP_ PKGNAME> and XDG_CONFIG_ HOME/<APP_ PKGNAME> . Apps
and have write access to directories they own as determined by the XDG
base directory specification. Specifically:
XDG_CACHE_
XDG_RUNTIME_
XDG_DATA_
can discover these paths using standard APIs and appending the package
name as defined by the 'name' field of the manifest."