Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

20 Commits

Repository files navigation

Build Status

minirent

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.

Usage

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.

About

A subset of dirent interface for Windows.

Resources

Stars

30 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages