mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 12:06:01 +01:00
create pathAccessible, use it to infer default dirs
This commit is contained in:
parent
a6c78ba367
commit
2c462486fe
5 changed files with 26 additions and 14 deletions
|
|
@ -266,6 +266,17 @@ bool pathExists(const Path & path)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool pathAccessible(const Path & path)
|
||||
{
|
||||
try {
|
||||
return pathExists(path);
|
||||
} catch (SysError & e) {
|
||||
// swallow EPERM
|
||||
if (e.errNo == EPERM) return false;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Path readLink(const Path & path)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue