GRASS GIS 8 Programmer's Manual
8.2.2dev(2023)-3d2c704037
|
GIS library - Mapset user permission routines. More...
#include <grass/config.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <grass/gis.h>
#include <grass/glocale.h>
Go to the source code of this file.
Functions | |
int | G_make_mapset_element (const char *p_element) |
Create element in the current mapset. More... | |
int | G_make_mapset_object_group (const char *type) |
Create directory for group of elements of a given type. More... | |
int | G_make_mapset_dir_object (const char *type, const char *name) |
Create directory for an object of a given type. More... | |
int | G_make_mapset_element_tmp (const char *p_element) |
Create element in the temporary directory. More... | |
int | G_make_mapset_object_group_tmp (const char *type) |
Create directory for type of objects in the temporary directory. More... | |
int | G__make_mapset_element_misc (const char *dir, const char *name) |
Create misc element in the current mapset. More... | |
int | G_mapset_permissions (const char *mapset) |
Check for user mapset permission. More... | |
int | G_mapset_permissions2 (const char *gisdbase, const char *location, const char *mapset) |
Check for user mapset permission. More... | |
GIS library - Mapset user permission routines.
(C) 1999-2014 The GRASS development team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file mapset_msc.c.
int G__make_mapset_element_misc | ( | const char * | dir, |
const char * | name | ||
) |
Create misc element in the current mapset.
dir | directory path (e.g., cell_misc ) |
name | element to be created in mapset (e.g., elevation ) |
Definition at line 232 of file mapset_msc.c.
References G_make_mapset_dir_object().
Referenced by I_fopen_subgroup_file_append(), I_fopen_subgroup_file_new(), Rast__close_null(), and Rast__quant_export().
int G_make_mapset_dir_object | ( | const char * | type, |
const char * | name | ||
) |
Create directory for an object of a given type.
Creates the specified element directory in the current mapset. It will check for the existence of the element and do nothing if it is found so this routine can be called even if the element already exists to ensure that it exists.
Any failure to create it, including the case when it exists (i.e., was created by another process after the existence test) is considered a failure because two processes should not attempt to create two objects of the same name (and type).
This function is for objects which are directories (the function does not create files).
Calls G_fatal_error() on failure.
type | object type (e.g., vector ) |
name | object name (e.g., bridges ) |
Definition at line 108 of file mapset_msc.c.
Referenced by G__make_mapset_element_misc(), Rast3d_make_mapset_map_directory(), and Vect_copy().
int G_make_mapset_element | ( | const char * | p_element | ) |
Create element in the current mapset.
Make the specified element in the current mapset will check for the existence of the element and do nothing if it is found so this routine can be called even if the element already exists.
Calls G_fatal_error() on failure.
p_element | element to be created in mapset |
Definition at line 44 of file mapset_msc.c.
References G_file_name(), G_mapset(), GPATH_MAX, and NULL.
int G_make_mapset_element_tmp | ( | const char * | p_element | ) |
Create element in the temporary directory.
See G_file_name_tmp() for details.
p_element | element to be created in mapset (e.g., elevation ) |
Definition at line 131 of file mapset_msc.c.
References G_file_name_tmp(), G_mapset(), GPATH_MAX, and NULL.
int G_make_mapset_object_group | ( | const char * | type | ) |
Create directory for group of elements of a given type.
Creates the specified element directory in the current mapset. It will check for the existence of the element and do nothing if it is found so this routine can be called even if the element already exists to ensure that it exists.
If creation fails, but the directory exists after the failure, the function reports success. Therefore, two processes creating a directory in this way can work in parallel.
Calls G_fatal_error() on failure.
type | object type (e.g., cell ) |
Definition at line 74 of file mapset_msc.c.
Referenced by db_set_default_connection(), M_do_copy(), and Rast__quant_export().
int G_make_mapset_object_group_tmp | ( | const char * | type | ) |
Create directory for type of objects in the temporary directory.
See G_file_name_tmp() for details.
type | object type (e.g., cell ) |
Definition at line 153 of file mapset_msc.c.
int G_mapset_permissions | ( | const char * | mapset | ) |
Check for user mapset permission.
mapset | mapset name |
Definition at line 262 of file mapset_msc.c.
References G_file_name(), G_stat(), and GPATH_MAX.
int G_mapset_permissions2 | ( | const char * | gisdbase, |
const char * | location, | ||
const char * | mapset | ||
) |
Check for user mapset permission.
gisdbase | full path to GISDBASE |
location | location name |
mapset | mapset name |
Definition at line 291 of file mapset_msc.c.