Mercurial > geeqie.yaz
diff src/ui_fileops.c @ 1360:721ffb823d6e
Introduce is_readable_file() which test if file exists, is regular and readable.
author | zas_ |
---|---|
date | Sun, 01 Mar 2009 17:10:45 +0000 |
parents | 681e79dd0820 |
children | 4da6d326919c |
line wrap: on
line diff
--- a/src/ui_fileops.c Sun Mar 01 16:46:40 2009 +0000 +++ b/src/ui_fileops.c Sun Mar 01 17:10:45 2009 +0000 @@ -419,6 +419,12 @@ return ret; } +gboolean is_readable_file(const gchar *s) +{ + if (!s || !s[0] || !isfile(s)) return FALSE; + return access_file(s, R_OK); +} + gint access_file(const gchar *s, gint mode) { gchar *sl;