www.delorie.com/djgpp/doc/libc-2.01/libc_491.html   search  
Go to the first, previous, next, last section, table of contents.


opendir

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.
__OPENDIR_FIND_HIDDEN
Include hidden files and directories 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.

Example

DIR *d = opendir(".");
closedir(d);


Go to the first, previous, next, last section, table of contents.

  prev next   webmaster     delorie software   privacy  
  Copyright © 1997     Updated Apr 1997