summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorDennis Camera <skonfig@dtnr.ch>2022-08-21 00:45:19 +0200
committerDennis Camera <skonfig@dtnr.ch>2022-08-21 00:47:31 +0200
commit02921040ade564177304b24ffbef15d45017b317 (patch)
tree773c844c71ca1d30b1c96e0b0da8bd4d6b775c79 /src/util
parentb307c6010c7439191064e80da04b6e1672b2001e (diff)
downloadskonfig-c-02921040ade564177304b24ffbef15d45017b317.tar.gz
skonfig-c-02921040ade564177304b24ffbef15d45017b317.zip
[src/run.c] Implement linking SK_PATH into local_hostdir
Diffstat (limited to 'src/util')
-rw-r--r--src/util/fs.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/util/fs.h b/src/util/fs.h
index 9701bc8..7be8527 100644
--- a/src/util/fs.h
+++ b/src/util/fs.h
@@ -13,11 +13,20 @@
#endif
/**
+ * exists:
+ * Check if a given pathname exists.
+ *
+ * @param pathname: the path to check
+ * @return true if @pathname exists, false otherwise.
+ */
+#define exists(pathname) (0 == access(pathname, F_OK))
+
+/**
* is_dir:
* Check if a given pathname is a directory.
*
- * @returns true if the given pathname exists and is a directory, false
- * otherwise.
+ * @param pathname: the path to check
+ * @return true if @pathname exists and is a directory, false otherwise.
*/
bool is_dir(const char *restrict pathname);