Comment 7 for bug 245716

Revision history for this message
William (billcoder) wrote :

I tracked down this bug. The source of the problem is in src/file-utils.c. It looks like File Roller calls _g_path_get_temp_work_dir, which searches the user's cache dir, user's home dir, and tmp, for a place to put the temporary folder. It searches in that order. The criteria for the search is available free space. The location with the most free space will be used. If two locations have the same amount of free space, the one searched first will be used.

The bug is that, at least on my system, /tmp and ~/.cache both have the same amount of free space. So ~/.cache gets used, since it's searched first.

This searching algorithm is reasonable, as opposed to just always using /tmp. What if File Roller is run on a system where /tmp is limited, and now the user can't extract an archive because /tmp keeps blowing up. So it makes sense to use whatever has the most available disk space.

I suggest fixing this by changing the search order. The search order is defined by:

static const char *try_folder[] = { "cache", "~", "tmp", NULL };

Let's change that to:

static const char *try_folder[] = { "tmp", "cache", "~", NULL };

It's a simple change, and for systems like mine, where /tmp is part of the root filesystem, File Roller will use tmp since it should have the same free space as cache.

A better solution may be a compile time option to force a particular folder, or a run-time preference. In both cases it will be up to the distro to configure the appropriate compile option or default preference, according to how their distro installs.

If someone lets me know: where to pull the latest File Roller source code, and how to submit a patch, I can at least submit a patch tweaking try_folder.