delorie.com/djgpp/doc/libc/libc_280.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

DTTOIF

Syntax

 
#include <dirent.h>

struct dirent *de;
mode_t file_mode = DTTOIF(de->d_type)

Description

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.

Return Value

The file's mode bits are returned. If the argument has the value DT_UNKNOWN, the result will be S_IFREG.

Portability

ANSI/ISO C No
POSIX No (see note 1)

Notes:

  1. This macro is available on systems which support the d_type member in struct dirent.

  webmaster     delorie software   privacy  
  Copyright © 2004     Updated Apr 2004