Xinqi Bao's Git
1 /* See LICENSE file for copyright and license details. */
10 num_files(const char *dir
)
16 if (!(fd
= opendir(dir
))) {
17 warn("opendir '%s':", dir
);
22 while ((dp
= readdir(fd
))) {
23 if (!strcmp(dp
->d_name
, ".") || !strcmp(dp
->d_name
, "..")) {
24 continue; /* skip self and parent */
31 return bprintf("%d", num
);