Synesis Software

Main Page   Modules   Compound List   File List   Compound Members   File Members  

opendir()/readdir() API
[Synesis Software UNIX Emulation for Win32]

This API provides facilities for enumerating the contents of directories. More...

Compounds

struct  dirent
 Results structure for readdir(). More...


Defines

#define NAME_MAX   (260)
 The maximum number of characters (including null terminator) in a directory entry name.


Typedefs

typedef dirent_dir DIR
 dirent_dir is defined internally


Functions

DIRopendir (const char *name)
 Returns a pointer to the next directory entry.

int closedir (DIR *dir)
 Closes a directory handle.

void rewinddir (DIR *dir)
 Resets a directory search position.

direntreaddir (DIR *dir)
 Returns a pointer to the next directory entry.


Detailed Description

This API provides facilities for enumerating the contents of directories.


Define Documentation

#define NAME_MAX   (260)
 

The maximum number of characters (including null terminator) in a directory entry name.


Typedef Documentation

typedef struct dirent_dir DIR
 

dirent_dir is defined internally


Function Documentation

int closedir DIR   dir
 

Closes a directory handle.

This function closes a directory handle that was opened with opendir() and releases any resources associated with that directory handle.

Parameters:
dir  The directory handle from which the entries are read
Returns:
0 on success, or -1 to indicate error.

DIR* opendir const char *    name
 

Returns a pointer to the next directory entry.

This function opens the directory named by filename, and returns a directory to be used to in subsequent operations. NULL is returned if name cannot be accessed, or if resources cannot be acquired to process the request.

Parameters:
name  The name of the directory to search
Returns:
The directory handle from which the entries are read or NULL

struct dirent* readdir DIR   dir
 

Returns a pointer to the next directory entry.

This function returns a pointer to the next directory entry, or NULL upon reaching the end of the directory or detecting an invalid seekdir() operation

Parameters:
dir  The directory handle from which the entries are read
Returns:
A dirent structure or NULL

void rewinddir DIR   dir
 

Resets a directory search position.

This function resets the position of the named directory handle to the beginning of the directory.

Parameters:
dir  The directory handle whose position should be reset

UNIX Emulation for Win32 Libraries documentation © Synesis Software Pty Ltd, 2001-2003