Enlightenment CVS committal Author : chaos Project : e17 Module : proto
Dir : e17/proto/entropy/src Modified Files: entropy_file.c Log Message: * Correct permissions parsing =================================================================== RCS file: /cvs/e/e17/proto/entropy/src/entropy_file.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- entropy_file.c 28 Mar 2006 10:31:14 -0000 1.10 +++ entropy_file.c 5 Apr 2006 02:10:54 -0000 1.11 @@ -118,3 +118,74 @@ return file_list; } + + + +char* entropy_generic_file_display_permissions_parse(entropy_generic_file* file) +{ + char* ret; + + if (!file || !file->retrieved_stat) return NULL; + + ret = entropy_malloc(sizeof(char)*10); + + /*D bit*/ + if (file->properties.st_mode & S_IFDIR) + ret[0] = 'd'; + else + ret[0] = ' '; + + /*Owner */ + if (file->properties.st_mode & S_IRUSR) + ret[1] = 'r'; + else + ret[1] = ' '; + + if (file->properties.st_mode & S_IWUSR) + ret[2] = 'w'; + else + ret[2] = ' '; + + if (file->properties.st_mode & S_IXUSR) + ret[3] = 'x'; + else + ret[3] = ' '; + /*----------*/ + + /*Group */ + if (file->properties.st_mode & S_IRGRP) + ret[4] = 'r'; + else + ret[4] = ' '; + + if (file->properties.st_mode & S_IWGRP) + ret[5] = 'w'; + else + ret[5] = ' '; + + if (file->properties.st_mode & S_IXGRP) + ret[6] = 'x'; + else + ret[6] = ' '; + /*----------*/ + + /*Other */ + if (file->properties.st_mode & S_IROTH) + ret[7] = 'r'; + else + ret[7] = ' '; + + if (file->properties.st_mode & S_IWOTH) + ret[8] = 'w'; + else + ret[8] = ' '; + + if (file->properties.st_mode & S_IXOTH) + ret[9] = 'x'; + else + ret[9] = ' '; + /*----------*/ + + + return ret; +} ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs