www.delorie.com/djgpp/doc/libc/libc_602.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]



#include <dirent.h>

extern int __opendir_flags;

DIR *opendir(char *name);


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:

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.

Do not include hidden files and directories in the search. By default, all files and directories are included.

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.

Include volume labels in the search. By default, these are skipped.

Do not compute the d_type member of struct dirent. If this flag is set, all files will get DT_UNKNOWN in the d_type member. By default, this flag is reset. See section readdir.

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.


POSIX 1003.2-1992; 1003.1-2001 (see note 1)


  1. The __opendir_flags variable is DJGPP-specific.


DIR *d = opendir(".");

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster     delorie software   privacy  
  Copyright © 2004     Updated Apr 2004