From 0e9ddbb0bf0cd34500155ea4b03de2e2a38d8ab2 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Mon, 16 Mar 2020 23:33:42 +0100 Subject: Well I'm using Arch again --- slstatus/components/num_files.c | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 slstatus/components/num_files.c (limited to 'slstatus/components/num_files.c') 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 -#include -#include - -#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); -} -- cgit v1.2.3