Go to the first, previous, next, last section, table of contents.
#include <dirent.h> struct dirent *de; mode_t file_mode = DTTOIF(de->d_type)
This macro converts the d_type
member of a struct dirent
variable, as returned by readdir
(see section readdir) to an
equivalent value of the st_mode
member of a struct stat
variable (see section stat).
Note that the access rights are not set in the result returned by this macro. Only the file-type information is copied.
The file's mode bits are returned. If the argument has the value
DT_UNKNOWN
, the result will be S_IFREG
.
not ANSI, not POSIX (see note 1)
Notes:
d_type
member in struct dirent
.
Go to the first, previous, next, last section, table of contents.