18 #include <sys/types.h>
19 #include <grass/dbmi.h>
23 static char *rfind(
char *
string,
char c);
24 static int make_parent_dir(
char *path,
int mode);
25 static int make_dir(
const char *path,
int mode);
41 char path2[GPATH_MAX];
44 if (make_parent_dir(path2, mode) != DB_OK)
48 return make_dir(path, mode);
54 static int make_dir(
const char *path,
int mode)
68 static int make_parent_dir(
char *path,
int mode)
73 slash = rfind(path,
'/');
74 if (slash ==
NULL || slash == path)
78 if (access(path, 0) == 0) {
81 else if (make_parent_dir(path, mode) != DB_OK) {
84 else if (make_dir(path, mode) == DB_OK) {
96 static char *rfind(
char *
string,
char c)
int G_mkdir(const char *path)
Creates a new directory.
void db_syserror(const char *s)
int db_driver_mkdir(const char *path, int mode, int parentdirs)
Create db directory.
int db_isdir(const char *path)