Dirent.h functions

This header provides functions ported from Unix in dirent.h. More...

Data Structures

struct  dirent
 A structure that describes a directory stream. More...
 

Macros

#define DT_UNKNOWN   0
 Specifies that the file type is unknown.
 
#define DT_DIR   4
 Specifies that the file type is a directory.
 

Typedefs

typedef struct DIR DIR
 A structure that describes a directory stream.
 

Functions

EAPI DIRopendir (char const *name)
 Open the given directory. More...
 
EAPI int closedir (DIR *dir)
 Close the given directory. More...
 
EAPI struct direntreaddir (DIR *dir)
 Read the given directory. More...
 

Detailed Description

This header provides functions ported from Unix in dirent.h.

Function Documentation

EAPI DIR* opendir ( char const *  name)

Open the given directory.

Parameters
nameThe directory to open.
Returns
A pointer to the directory stream.

This function opens the directory name and return the directory stream. On error or if dir is NULL, -1 is returned, and errno is set appropriately (on Windows XP only). On success, 0 is returned.

See Also
closedir()
readdir()

Conformity: None.

Supported OS: Windows XP, CE.

Examples:
ecore_thread_example.c.

References dirent::d_name, DT_DIR, DT_UNKNOWN, evil_char_to_wchar(), and evil_wchar_to_char().

Referenced by ecore_file_mksubdirs(), eina_file_direct_ls(), eina_file_ls(), and eina_file_stat_ls().

EAPI int closedir ( DIR dir)

Close the given directory.

Parameters
dirThe directory stream to close.
Returns
A pointer to the directory stream.

This function closes the stream directory dir. On error or is path is NULL or an empty string, NULL is returned, and errno is set appropriately (on Windows XP only).

See Also
opendir()
readdir()

Conformity: None.

Supported OS: Windows XP, CE.

Examples:
ecore_thread_example.c.

Referenced by ecore_file_mksubdirs(), eina_file_direct_ls(), eina_file_ls(), and eina_file_stat_ls().

EAPI struct dirent* readdir ( DIR dir)

Read the given directory.

Parameters
dirThe directory stream to read.
Returns
A pointer to a dirent structure, NULL oterhwise.

This function returns a pointer to a dirent structure representing the next directory entry in the directory stream pointed to by dir. It returns NULL on reaching the end of the directory stream or if an error occurred and errno is set appropriately (on Windows XP only).

See Also
opendir()
readdir()

Conformity: None.

Supported OS: Windows XP, CE.

References dirent::d_name, and evil_wchar_to_char().