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