Borland C++ reference

closedir

raw OCR

Closes a directory stream.

Defined in header <dirent.h>

Syntax

#include <dirent.h>
void closedir(DlR *dirp);

Portability

DOSUNIXWindowsANSI CC++ only
■■■

Remarks

On UNIX platforms, closedir is available on POSIX-compliant systems.

The closedir function closes the directory stream dirp, which must have been opened by a previous call to opendir. After the stream is closed, dirp no longer points to a valid directory stream.

Return value

If closedir is successful, it returns 0. Otherwise, closedir returns -1 and sets the global variable errno to

EBADFThe dirp argument does not point to a valid open directory

See also

Example

See the example  for opendir.

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.