aboutsummaryrefslogtreecommitdiff
path: root/src/c.c
blob: c54469ab06abaf6903ece3972c1b8a783620e18d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <sys/stat.h>
#include <dirent.h>

int is_dir(const char *path)
{
    struct stat m;
    int r = stat(path, &m);
    return r == 0 && S_ISDIR(m.st_mode);
}

const char *get_d_name(struct dirent *d)
{
    return (const char *) d->d_name;
}