dir
Purpose
Describes the format of a directory.
Synopsis
#include <sys/dir.h>
Description
A directory is a file that a user is not allowed to write
into directly. A directory file contains a 16-byte entry
for each file in it. A bit in the flag word of the
i-node entry indicates that the corresponding file should
be treated as a directory. For additional information
about a system volume format, see the "fs." The structure
of a directory entry as given in the include file is:
#include <sys/types.h>
#ifndef DIRSIZ
#define DIRSIZ 14
#endif
struct direct
{
ino_t d_ino;
char d_name[DIRSIZ];
};
By convention, the first two entries in each directory
are . (dot) and .. (dot dot). The first . is an entry
for the directory itself. The .. entry is for the parent
directory. The meaning of the .. entry for the root
directory of the master file system is modified. There
is no parent directory; therefore, the .. entry has the
same meaning as the . entry.
Related Information
In this book: "fs" and "inode."