00001 #include <grass/dbmi.h> 00002 #include <unistd.h> 00003 #include <sys/types.h> 00004 #include <sys/stat.h> 00005 00012 int db_isdir(const char *path) 00013 { 00014 struct stat x; 00015 00016 if (stat(path, &x) != 0) 00017 return DB_FAILED; 00018 return (S_ISDIR(x.st_mode) ? DB_OK : DB_FAILED); 00019 }