diff -r 8a7f8272516c -r 644a6106d712 thermferm/futil.c --- a/thermferm/futil.c Sun Nov 08 22:20:42 2015 +0100 +++ b/thermferm/futil.c Sat Nov 14 16:52:33 2015 +0100 @@ -58,3 +58,21 @@ } + +/* + * Test if the given file exists. The second option is: + * R_OK - test for Read rights + * W_OK - test for Write rights + * X_OK - test for eXecute rights + * F_OK - test file presence only + */ +int file_exist(char *path, int mode) +{ + if (access(path, mode) != 0) + return errno; + + return 0; +} + + +