2

When fdupes is run with the --cache option, it says: "Speed up file comparisons by keeping track of their signatures in a database."

Where is that database stored? It also seems that there is no option (yet) to set a custom location for it.

1 Answer 1

2

Where is that database stored?

Looking at the source code, it seems to use the environment variable XDG_CACHE_HOME with a base name of .cache:

#define XDG_CACHE_HOME_BASENAME ".cache"
#define XDG_CACHE_HOME_PERMISSIONS 0700

char *getcachehome(int createdefault)
{
    char *cachedir;
    char *homedir;
    char *result;
    size_t pathlength;
    size_t defaultdirlength;
    struct passwd *pw;
    struct stat st;

    cachedir = getenv("XDG_CACHE_HOME");

Source: fdupes/xdgbase.c at master · adrianlopezroche/fdupes · GitHub


It also seems that there is no option (yet) to set a custom location for it.

You can set XDG_CACHE_HOME to a custom location.

$XDG_CACHE_HOME defines the base directory relative to which user-specific non-essential data files should be stored. If $XDG_CACHE_HOME is either not set or empty, a default equal to $HOME/.cache should be used.

Source: XDG Base Directory Specification

1
  • Thanks for checking the source code. Basing from your answer, I found the database in ~/.cache/fdupes/hash.db. My $XDG_CACHE_HOME is unset.
    – Majal
    Commented May 18 at 6:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .