diff options
| author | Dennis Camera <skonfig@dtnr.ch> | 2022-08-21 00:45:19 +0200 |
|---|---|---|
| committer | Dennis Camera <skonfig@dtnr.ch> | 2022-08-21 00:47:31 +0200 |
| commit | 02921040ade564177304b24ffbef15d45017b317 (patch) | |
| tree | 773c844c71ca1d30b1c96e0b0da8bd4d6b775c79 /src/util | |
| parent | b307c6010c7439191064e80da04b6e1672b2001e (diff) | |
| download | skonfig-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.h | 13 |
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); |
