thermferm/futil.c

changeset 420
644a6106d712
parent 268
dda91dfa4aa8
--- 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;
+}
+
+
+

mercurial