GRASS 8 Programmer's Manual
8.6.0dev(2026)-f6f2c534ea
Loading...
Searching...
No Matches
isdir.c
Go to the documentation of this file.
1
/*!
2
\file lib/db/dbmi_base/isdir.c
3
4
\brief DBMI Library (base) - test for directories
5
6
(C) 1999-2009, 2011 by the GRASS Development Team
7
8
This program is free software under the GNU General Public License
9
(>=v2). Read the file COPYING that comes with GRASS for details.
10
11
\author Joel Jones (CERL/UIUC), Radim Blazek
12
\author Doxygenized by Martin Landa <landa.martin gmail.com> (2011)
13
*/
14
15
#include <
grass/config.h
>
16
#include <
grass/dbmi.h
>
17
#include <
unistd.h
>
18
#include <sys/types.h>
19
#include <
sys/stat.h
>
20
21
/*!
22
\brief Test if path is a directory
23
24
\param path pathname
25
26
\return DB_OK on success
27
\return DB_FAILED on failure
28
*/
29
int
db_isdir
(
const
char
*
path
)
30
{
31
struct
stat
x
;
32
33
if
(
stat
(
path
, &
x
) != 0)
34
return
DB_FAILED
;
35
return
(
S_ISDIR
(
x
.st_mode) ?
DB_OK
:
DB_FAILED
);
36
}
AMI_STREAM
Definition
ami_stream.h:153
AMI_STREAM::AMI_STREAM
AMI_STREAM()
Definition
ami_stream.h:227
config.h
dbmi.h
Main header of GRASS DataBase Management Interface.
DB_FAILED
#define DB_FAILED
Definition
dbmi.h:72
DB_OK
#define DB_OK
Definition
dbmi.h:71
db_isdir
int db_isdir(const char *path)
Test if path is a directory.
Definition
isdir.c:29
stat.h
S_ISDIR
#define S_ISDIR(mode)
Definition
stat.h:6
path
Definition
path.h:15
unistd.h
x
#define x
lib
db
dbmi_base
isdir.c
Generated on Sun Apr 12 2026 06:59:14 for GRASS 8 Programmer's Manual by
1.9.8