mirror of
https://github.com/NixOS/nix
synced 2025-06-30 19:57:59 +02:00
* A command to query the paths referenced by an fstate expression.
* Use a temporary directory for build actions.
This commit is contained in:
parent
a279137327
commit
40274c1f4f
6 changed files with 198 additions and 97 deletions
12
src/util.cc
12
src/util.cc
|
@ -66,6 +66,18 @@ string baseNameOf(string path)
|
|||
}
|
||||
|
||||
|
||||
bool pathExists(const string & path)
|
||||
{
|
||||
int res;
|
||||
struct stat st;
|
||||
res = stat(path.c_str(), &st);
|
||||
if (!res) return true;
|
||||
if (errno != ENOENT)
|
||||
throw SysError(format("getting status of %1%") % path);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void deletePath(string path)
|
||||
{
|
||||
struct stat st;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue