diff options
author | Marvin Borner | 2020-03-16 23:33:42 +0100 |
---|---|---|
committer | Marvin Borner | 2020-03-16 23:33:42 +0100 |
commit | 0e9ddbb0bf0cd34500155ea4b03de2e2a38d8ab2 (patch) | |
tree | 719da1c7fe5dabb872fe9ff1582c39b55ccd488e /slstatus/components/num_files.c | |
parent | e5d38956336ab1be954bdbd12808c5f98f8bd925 (diff) |
Well I'm using Arch again
Diffstat (limited to 'slstatus/components/num_files.c')
-rw-r--r-- | slstatus/components/num_files.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/slstatus/components/num_files.c b/slstatus/components/num_files.c deleted file mode 100644 index fb55df9..0000000 --- a/slstatus/components/num_files.c +++ /dev/null @@ -1,31 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include <dirent.h> -#include <stdio.h> -#include <string.h> - -#include "../util.h" - -const char * -num_files(const char *path) -{ - struct dirent *dp; - DIR *fd; - int num; - - if (!(fd = opendir(path))) { - warn("opendir '%s':", path); - return NULL; - } - - num = 0; - while ((dp = readdir(fd))) { - if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) { - continue; /* skip self and parent */ - } - num++; - } - - closedir(fd); - - return bprintf("%d", num); -} |