On Wed, Jun 15, 2011 at 6:50 AM, Vincent Torri <vto...@univ-evry.fr> wrote: > On Wed, 15 Jun 2011, Enlightenment SVN wrote: >> Log: >> From: Ulrich Eckhardt <dooms...@knuut.de> >> Subject: [E-devel] Provide sensible errors for edje utilities >> >> If you start edje_player or edje_inspector with a path to a file that >> doesn't >> exist you get a bogus error message saying that the file doesn't contain any >> groups. The attached patch uses access() to check if the program can read >> the >> file, giving a sensible error message if not. >> >> I have checked the other utilities there, too, and they work, with the >> exception of edje_external_inspector. I'm not sure how this one works at >> all, >> but it seems not to take a file but a list of modules, maybe someone with >> greater insight can take a look at that. >> >> Going through things installed under bin, I'll take a look if those behave >> properly and create patches for those, too, if this one is okay. >> >> >> >> Author: raster >> Date: 2011-06-15 02:38:08 -0700 (Wed, 15 Jun 2011) >> New Revision: 60338 >> Trac: http://trac.enlightenment.org/e/changeset/60338 >> >> Modified: >> trunk/edje/src/bin/edje_inspector.c trunk/edje/src/bin/edje_player.c >> >> Modified: trunk/edje/src/bin/edje_inspector.c >> =================================================================== >> --- trunk/edje/src/bin/edje_inspector.c 2011-06-15 09:34:16 UTC (rev >> 60337) >> +++ trunk/edje/src/bin/edje_inspector.c 2011-06-15 09:38:08 UTC (rev >> 60338) >> @@ -11,6 +11,7 @@ >> #include <Ecore_Getopt.h> >> #include <locale.h> >> #include <fnmatch.h> >> +#include <unistd.h> >> >> static int _log_dom; >> #define DBG(...) EINA_LOG_DOM_DBG(_log_dom, __VA_ARGS__) >> @@ -1577,6 +1578,15 @@ >> >> file = argv[arg_index]; >> >> + // check if the file is accessible >> + if (access(file, R_OK) == -1) > > i prefer ecore_file_exists as it is cross platform...
AFAIR I use edje load error, so if it's returning a bogus message it's better to fix it there, be with ecore_file_exists() or access(). That way all applications are fixed. -- Gustavo Sverzut Barbieri http://profusion.mobi embedded systems -------------------------------------- MSN: barbi...@gmail.com Skype: gsbarbieri Mobile: +55 (19) 9225-2202 ------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel