Mercurial > trustbridge
diff common/portpath.h @ 168:f100861dad8f
Added simple portable function to test if an file exists.
author | Sascha Wilde <wilde@intevation.de> |
---|---|
date | Tue, 25 Mar 2014 13:08:59 +0100 |
parents | 92d7e0b40808 |
children | 70d627e9e801 |
line wrap: on
line diff
--- a/common/portpath.h Tue Mar 25 12:54:47 2014 +0100 +++ b/common/portpath.h Tue Mar 25 13:08:59 2014 +0100 @@ -1,6 +1,8 @@ #ifndef PORTPATH_H #define PORTPATH_H +#include <stdbool.h> + /** * @file portpath.h * @brief Platform independent functions for file and path handling. @@ -28,4 +30,13 @@ */ char *port_realpath(char *path); +/** + * @brief test if a file exists + * @details uses a platform specific stat call to test if the given + * file exists. + * @param[in] path the path to the file + * @returns true if the file exists and false otherwise + */ +bool port_fileexits(char *path); + #endif