A subset of dirent interface for Windows.
The code that works with minirent must work with the dirent.
Use minirent as a cross-platform replacement of dirent if you only need the subset interface.
minirent.h is an stb-style header-only library. That means that when you just include it it does not include the implementations of the functions. You have to define MINIRENT_IMPLEMENTATION macro:
#include<assert.h>#include<stdio.h>#include<stdlib.h>#defineMINIRENT_IMPLEMENTATION#include<minirent.h>intmain(void)
{
DIR*dir=opendir(".");
assert(dir);
errno=0;
structdirent*dp=NULL;
while ((dp=readdir(dir))) {
printf("%s\n", dp->d_name);
}
assert(errno==0);
interr=closedir(dir);
assert(err==0);
return0;
}For more information see ./examples/ folder.