Skip to content

Instantly share code, notes, and snippets.

@dinvlad
dinvlad / gist:83c078481649a35e16d9112d2743dab9
Last active July 28, 2019 07:40 — forked from mackstann/gist:4229933
Gigantic recursive directory entry counter
// http://www.olark.com/spw/2011/08/you-can-list-a-directory-with-8-million-files-but-not-with-ls/
#define _GNU_SOURCE
#include <dirent.h> /* Defines DT_* constants */
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/syscall.h>