O'Reilly logo
  • Ivan Petrov thinks this is interesting:

S_ISREG(stbuf. st_mode)

  • Returns true if filename is a regular file.

S_ISDIR(stbuf.st_mode)

  • Returns true if filename is a directory.

S_ISCHR(stbuf.st_mode)

  • Returns true if filename is a character device. Devices are shortly discussed in more detail.

From

Cover of Linux® Programming by Example

Note

MACROS for determining the file type