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

int c_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;
}