1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-26 04:00:59 +01:00

create pathAccessible, use it to infer default dirs

(cherry picked from commit 2c462486fe)
This commit is contained in:
Yorick van Pelt 2023-05-26 15:32:28 +02:00 committed by Emily
parent a1c22a7c10
commit 8a9b22b604
5 changed files with 26 additions and 14 deletions

View file

@ -119,6 +119,14 @@ struct stat lstat(const Path & path);
*/
bool pathExists(const Path & path);
/**
* A version of pathExists that returns false on a permission error.
* Useful for inferring default paths across directories that might not
* be readable.
* @return true iff the given path can be accessed and exists
*/
bool pathAccessible(const Path & path);
/**
* Read the contents (target) of a symbolic link. The result is not
* in any way canonicalised.