@node opendir, file system @subheading Syntax @example #include extern int __opendir_flags; DIR *opendir(char *name); @end example @subheading 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 @code{closedir} when you are done with it. @xref{readdir}. The global variable @code{__opendir_flags} can be set to include the following values to control the operation of @code{opendir}: @table @code @item __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 @file{README} and @file{FAQ} from Unix distributions to be returned in upper-case on Windows 9X filesystems. @xref{_preserve_fncase}, for other ways of achieving this and for more detailed description of the automatic letter-case conversion by DJGPP library functions. @item __OPENDIR_NO_HIDDEN Do not include hidden files and directories in the search. By default, all files and directories are included. @item __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. @item __OPENDIR_FIND_LABEL Include volume labels in the search. By default, these are skipped. @end table You can simply put @samp{int __opendir_flags = ...;} in your code. The default is to let it get set to zero as an uninitialized variable. @subheading Return Value The open directory structure, or @code{NULL} on error. @subheading Portability @port-note posix The @code{__opendir_flags} variable is DJGPP-specific. @portability !ansi, posix @subheading Example @example DIR *d = opendir("."); closedir(d); @end example