diff src/ui_fileops.c @ 40:dcc04a6a58bf

Sat Apr 16 12:29:42 2005 John Ellis <johne@verizon.net> * pan-view.c: Add option to ignore symbolic links to folders when creating file list (no gui control yet), and do not allow listing the root folder as this introduces too many issues (for instance how do we ignore special filesystems such as /proc using only stat attributes?). Add fix to not show empty folders in the flower view. * thumb_standard.c (thumb_loader_std_finish): Fix logic that caused thumbnails to be saved for images with a size between normal and large when using large thumbnails. * ui_fileops.[ch]: Add utilities lstat_utf8 and islink. ##### Note: GQview CVS on sourceforge is not always up to date, please use ##### ##### an offical release when making enhancements and translation updates. #####
author gqview
date Sat, 16 Apr 2005 16:26:49 +0000
parents d907d608745f
children 31759d770628
line wrap: on
line diff
--- a/src/ui_fileops.c	Thu Apr 14 14:56:17 2005 +0000
+++ b/src/ui_fileops.c	Sat Apr 16 16:26:49 2005 +0000
@@ -197,6 +197,19 @@
 	return ret;
 }
 
+gint lstat_utf8(const gchar *s, struct stat *st)
+{
+	gchar *sl;
+	gint ret;
+
+	if (!s) return FALSE;
+	sl = path_from_utf8(s);
+	ret = (lstat(sl, st) == 0);
+	g_free(sl);
+
+	return ret;
+}
+
 gint isname(const gchar *s)
 {
 	struct stat st;
@@ -218,6 +231,13 @@
 	return (stat_utf8(s ,&st) && S_ISDIR(st.st_mode));
 }
 
+gint islink(const gchar *s)
+{
+	struct stat st;
+   
+	return (lstat_utf8(s ,&st) && S_ISLNK(st.st_mode));
+}
+
 gint64 filesize(const gchar *s)
 {
 	struct stat st;