--- a/gplate/variables/gplate-file-variable.c Sun Nov 15 01:57:35 2009 -0600
+++ b/gplate/variables/gplate-file-variable.c Sat Jun 19 20:28:56 2010 -0500
@@ -74,7 +74,7 @@
gplate_file_variable_real_refresh(GPlateFileVariable *file_variable) {
GPlateCollection *collection = NULL;
GPlateVariable *filename_var = NULL;
- const gchar *filename = NULL;
+ const gchar *filename = NULL, *type = NULL; collection = GPLATE_COLLECTION(file_variable);
@@ -108,6 +108,26 @@
gplate_collection_add_integer(collection, "atime", st.st_atime);
gplate_collection_add_integer(collection, "mtime", st.st_mtime);
gplate_collection_add_integer(collection, "ctime", st.st_ctime);
+ /* now add a type according to st_mode */ + if(S_ISREG(st.st_mode)) + else if(S_ISDIR(st.st_mode)) + else if(S_ISCHR(st.st_mode)) + type = "character device"; + else if(S_ISBLK(st.st_mode)) + else if(S_ISFIFO(st.st_mode)) + else if(S_ISLNK(st.st_mode)) + type = "symbolic link"; + else if(S_ISSOCK(st.st_mode)) + gplate_collection_add_string(collection, "type", type); /******************************************************************************