XDG base directories and trash outside $HOME device

Maurício Antunes mauricio.antunes at gmail.com
Thu May 22 08:26:29 PDT 2014


Hi,

XDG base directory specification [1] doesn't state that $XDG_DATA_HOME
should reside at a specific device, like, say, the same device as
$HOME is (I usually direct it to what 'mktemp -d' gives me when I log
in, which will be inside /tmp). XDG trash can specification says that
the user's "home trash" location is $XDG_DATA_HOME/Trash, and that it
"should function as the user's main trash directory. Files that the user
trashes from the same file system (device/partition) should be stored
here." [2] However, if $XDG_DATA_HOME is not in the same filesystem as
where an user saves most of his files, the home trash is not going to
be his main trash directory (in the sense that most of his files are
not going to end there).

I've found a bug in glib's GIO function g_local_file_trash [3], which
fails to find a trash directory for files in $HOME when $XDG_DATA_HOME
is not in the same device. Before I submit a patch, though, I would like
to check if my assumptions are right:

Is it okay to have $XDG_DATA_HOME in a device that is not the same
as $HOME?

Should not that trash spec quote be refrased to say just that the "home
trash" should always be used for files trashed in the same device,
but not that it's an user's main trash dir?

Thanks,
Maurício

[1]: http://standards.freedesktop.org/basedir-spec/latest
[2]: http://www.ramendik.ru/docs/trashspec.html
[3]: https://git.gnome.org/browse/glib/tree/gio/glocalfile.c


More information about the xdg mailing list