Figure out the user's home directory if $HOME is not set

This commit is contained in:
Eelco Dolstra 2017-05-05 16:40:12 +02:00
parent eba840c8a1
commit 465cb68244
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
8 changed files with 84 additions and 36 deletions

View file

@ -110,6 +110,9 @@ void deletePath(const Path & path, unsigned long long & bytesFreed);
Path createTempDir(const Path & tmpRoot = "", const Path & prefix = "nix",
bool includePid = true, bool useGlobalCounter = true, mode_t mode = 0755);
/* Return $HOME or the user's home directory from /etc/passwd. */
Path getHome();
/* Return $XDG_CACHE_HOME or $HOME/.cache. */
Path getCacheDir();