POSIX Directory Browsing API for Windows

The functions and types specified in POSIX for iterating over directory entries have been defined here as wrappers for porting to and common use on Windows platforms. The values of errno set in the event of errors are the most significant difference between the POSIX definition and the wrapper API.

In addition to this documentation file, the software is provided in the dirent.h header file and the dirent.c C source file. To use the API ensure that the path to the dirent.h header is either somewhere standard or is provided to the compiler as an additional option. Ensure also that the dirent.c file is compiled and the object file is either referenced explicitly in the link or included in a referenced library. The source code also compiles cleanly as C++, but it retains C linkage.


<dirent.h>


DIR *opendir(const char *name);

Description

Returns

Errors


int closedir(DIR *dir);

Description

Returns

Errors


struct dirent *readdir(DIR *dir);

Description

Returns

Errors


void rewinddir(DIR *dir);

Description

Returns

Errors


© Copyright Kevlin Henney