Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

closedir - close directory

&pagelevel(4)&pagelevel

Syntax

#include <dirent.h>

Optional
#include <sys/types.h> (End)

int closedir(DIR *dirp); 

Description

closedir() closes the directory stream referred to by the argument dirp. Upon return, the
value of dirp will no longer point to an accessible object of the type DIR. The file descriptor
used in the DIR structure is closed. 

Return val.

0

-1

if successful.

if an error occurs; errno is set to indicate the error.

Errors

closedir() will fail if:

EBADF

EINTR

The dirp argument does not refer to an open directory stream.

closedir() was interrupted by a signal.

Notes

See also

closedir() is executed only for POSIX files.

opendir(), dirent.h, sys/types.h.