diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-07-08T13·22+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-07-08T13·22+0000 |
commit | 40274c1f4f763e634dd031f7a6b4ba8ce2de7a82 (patch) | |
tree | 87f701e59cbe12fc86a9e67aa04ac1321533400c /src/util.cc | |
parent | a279137327ad5762bb26a23ce8ed7863812254ae (diff) |
* A command to query the paths referenced by an fstate expression.
* Use a temporary directory for build actions.
Diffstat (limited to 'src/util.cc')
-rw-r--r-- | src/util.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util.cc b/src/util.cc index 2f9c43e55ce5..8ccd3c1524d8 100644 --- a/src/util.cc +++ b/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; |