O'Reilly logo

Advanced UNIX Programming by Warren W. Gay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

File System Objects

Modern UNIX file systems support the following types of file system objects:

  • Regular Files (S_IFREG)

  • Directories (S_IFDIR)

  • Character Devices (S_IFCHR)

  • Block Devices (S_IFBLK)

  • Named Pipes (S_IFIFO)

  • Sockets (S_IFSOCK)

  • Symbolic Links (S_IFLNK)

The C macro names given within parentheses are provided by the include file <sys/stat.h> (see stat(2)). You'll see more of these in Chapter 6, "Managing Files and Their Properties."

Regular Files

A regular file is generally what is most important to users of a system. It stores the data that the user wants to retrieve and work with at a later time. The UNIX file system presents this data as a continuous stream of bytes.

A regular file consists of any number of data bytes, from zero to some ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required