Go to the first, previous, next, last section, table of contents.
Syntax
#include <dirent.h>
extern int __opendir_flags;
DIR *opendir(char *name);
Description
This function "opens" a directory so that you can read the list of file
names in it. The pointer returned must be passed to closedir
when you are done with it. See section readdir.
The global variable __opendir_flags
can be set to include the
following values to control the operation of opendir
:
__OPENDIR_PRESERVE_CASE
-
Do not change the case of files to lower case. Just in case Micros*ft
decides to support case-sensitive file systems some day.
You can also use this flag if you want the names of files like
`README' and `FAQ' from Unix distributions to be returned in
upper-case on Windows 9X filesystems. See section _preserve_fncase, for
other ways of achieving this and for more detailed description of the
automatic letter-case conversion by DJGPP library functions.
__OPENDIR_NO_HIDDEN
-
Do not include hidden files and directories in the search. By default,
all files and directories are included.
__OPENDIR_FIND_HIDDEN
-
Provided for back-compatibility with previous DJGPP versions, where
hidden files and directories were by default skipped. In versions 2.02
and later, this flag has no effect.
__OPENDIR_FIND_LABEL
-
Include volume labels in the search. By default, these are skipped.
You can simply put `int __opendir_flags = ...;' in your code. The
default is to let it get set to zero as an uninitialized variable.
Return Value
The open directory structure, or NULL
on error.
Portability
not ANSI, POSIX (see note 1)
Notes:
-
The
__opendir_flags
variable is DJGPP-specific.
Example
DIR *d = opendir(".");
closedir(d);
Go to the first, previous, next, last section, table of contents.