summaryrefslogtreecommitdiffstats
path: root/common/os_calls.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/os_calls.c')
-rw-r--r--common/os_calls.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/common/os_calls.c b/common/os_calls.c
index 524d8190..592d7d6d 100644
--- a/common/os_calls.c
+++ b/common/os_calls.c
@@ -2234,6 +2234,18 @@ g_file_exist(const char *filename)
}
/*****************************************************************************/
+/* returns boolean, non zero if the file is readable */
+int
+g_file_readable(const char *filename)
+{
+#if defined(_WIN32)
+ return 0; /* TODO: what should be done here? */
+#else
+ return access(filename, R_OK) == 0;
+#endif
+}
+
+/*****************************************************************************/
/* returns boolean, non zero if the directory exists */
int
g_directory_exist(const char *dirname)