~/.gnucash and XDG default directories

Jeff Kletsky gnucash at allycomm.com
Sun Jan 16 10:37:02 EST 2011


In my opinion, adopting a "standard" that

* goes counter to long-established practice

* isn't widely accepted

will cause more problems than it is worth.


There is a significant documentation change cost for GNUCash.


There is a significant coding/test cost (either auto-upgrade, or 
checking two locations, and possibly having both present)


There is a significant support cost ("Where are the config files? They 
aren't where everything else is.")


As far as I can tell, there is nothing that I use on FreeBSD that uses 
~/.local/share (they are very adamant about non-base applications 
installing system-wide data into /usr/local/etc, not letting everything 
throw into crap into /etc) and on Ubuntu, only webkit's icons and 
gvfs-metadata are found there.


On Mac, things generally go into ~/Library/Application Support (though I 
haven't read developer docs for OS X in ages).

Jeff


On 01/16/2011 07:19 AM, Geert Janssens wrote:
> Historically, GnuCash has always stored its user specific application data in
> ~/.gnucash based on old linux (unix ?) conventions.
>
> This didn't work really well on Mac OS X/Quartz, so John has overridden this
> path on OS X to make more sense there.
>
> Now there's a bugreport that indicates this isn't the best place on Windows
> either [1].
>
> I could override the path on Windows as well and be done with it, but in my
> investigation I found that even on linux ~/.<appname>  is no longer the
> recommended place to store such information.
>
> According to the XDG Base Directory Specification [2] the preferred location
> is ~/.local/share/<appname>.
>
> The nice thing is, glib has a convenience function g_get_user_config_dir,
> which by default returns ~/.local/share on linux and the equivalent and proper
> ~\Application Data (Windows XP) or ~\AppData\Roaming (Windows Vista/7).
>
> I don't know what this routine returns on OS X, but I would expect it to
> return the proper location for user specific application data there as well.
> If not that should be reported as a bug againse glib on OS X.
>
> In this light I would like to update the GnuCash code to make use of the
> g_get_user_data_dir function on all platforms and rename the directory from
> .gnucash to gnucash. That would give a better experience on all platforms IMO.
> This is what the directories would become:
> - Linux: ~/.local/share/gnucash
> - Windows XP: c:\Documents and Settings\<user>\Application Data\gnucash
> - Windows Vista/7: c:\Documents and Settings\<user>\AppData\Roaming\gnucash
> - OS X: ?
>
> I would obviously have to provide some conversion code as well, that would
> copy the old .gnucash contents to .local/share/gnucash to guarantee continuity
> for the users.
>
> I also think this change may be better for 2.5/2.6 than 2.4.1.
>
> Does anyone have any objections to this ?
>
> Geert
>
> [1] see https://bugzilla.gnome.org/show_bug.cgi?id=503722
> [2] see http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel


More information about the gnucash-devel mailing list