Revision: 1456
http://geeqie.svn.sourceforge.net/geeqie/?rev=1456&view=rev
Author: zas_
Date: 2009-03-01 17:10:45 +0000 (Sun, 01 Mar 2009)
Log Message:
-----------
Introduce is_readable_file() which test if file exists, is regular and readable.
Modified Paths:
--------------
trunk/src/ui_fileops.c
trunk/src/ui_fileops.h
Modified: trunk/src/ui_fileops.c
===================================================================
--- trunk/src/ui_fileops.c 2009-03-01 16:46:40 UTC (rev 1455)
+++ trunk/src/ui_fileops.c 2009-03-01 17:10:45 UTC (rev 1456)
@@ -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;
Modified: trunk/src/ui_fileops.h
===================================================================
--- trunk/src/ui_fileops.h 2009-03-01 16:46:40 UTC (rev 1455)
+++ trunk/src/ui_fileops.h 2009-03-01 17:10:45 UTC (rev 1456)
@@ -54,6 +54,7 @@
gint64 filesize(const gchar *s);
time_t filetime(const gchar *s);
gint filetime_set(const gchar *s, time_t tval);
+gboolean is_readable_file(const gchar *s);
gint access_file(const gchar *s, gint mode);
gint unlink_file(const gchar *s);
gint symlink_utf8(const gchar *source, const gchar *target);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn