使用方法：下载后将 dirent.h 复制到对应的包含目录即可，比如
D:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\
Dirent is an application programming interface (API) that enables programmers to list files and directories.
Dirent API is commonly available in UNIX systems but not all compilers in Windows provide it. In particular,
Microsoft Visual Studio lacks a dirent interface.
Thus, if you are porting software to Windows, you may find yourself rewriting code for Microsoft specific APIs.
In order to reduce this work, I have create a clone of the dirent interface for Microsoft Visual Studio.
The interface attempts to mimic the genuine UNIX API so that you could use the familiar UNIX data structures
and function calls in both Windows and UNIX without modifying source code for one platform or the other.
Download & Install
At first, download dirent installation package. The latest version is 1.20.1 (April 2014).
To install dirent, unpack the zip file and copy includes/dirent.h file to system include directory.
System include directory contains header files such as assert.h and windows.h, and it is usually located at
C:\Program Files\Microsoft Visual Studio 9.0\VC\include
Dirent API is implemented completely in the dirent.h file and you can use dirent just as in UNIX once you haved copied the file.
The installation package also contains a few example programs and Visual Studio 2008 project file to get you started.
For more information on using dirent, please see Open Group.
用户浏览此论坛: 没有注册用户 和 1 访客