16 #include <sys/types.h>
18 #include <grass/gis.h>
19 #include <grass/glocale.h>
56 if (*element ==
'/' || *element == 0) {
58 if (access(path, 0) != 0) {
61 p_element, path, strerror(
errno));
63 if (access(path, 0) != 0)
64 G_fatal_error(_(
"Unable to access mapset element %s (%s): %s"),
65 p_element, path, strerror(
errno));
84 char buf[GNAME_MAX * 2 + 1];
86 sprintf(buf,
"%s/%s", dir, name);
101 char path[GPATH_MAX];
106 if (
G_stat(path, &info) != 0)
108 if (!S_ISDIR(info.st_mode))
112 if (info.st_uid != getuid())
114 if (info.st_uid != geteuid())
135 char path[GPATH_MAX];
138 sprintf(path,
"%s/%s/%s", gisdbase, location, mapset);
140 if (
G_stat(path, &info) != 0)
142 if (!S_ISDIR(info.st_mode))
146 if (info.st_uid != getuid())
148 if (info.st_uid != geteuid())