DIR(5) — UNIX Programmer’s Manual
NAME
dir − format of directories
SYNOPSIS
#include <sys/types.h>
#include <sys/dirent.h>
DESCRIPTION
A directory behaves exactly like an ordinary file, save that no user may write into a directory. The fact that a file is a directory is indicated by a bit in the flag word of its i-node entry; see fs(5). The structure of a directory entry is given in the subsidiary include file sys/dirent.h. The structures presented there contain file system independent information.
By convention, the first two entries in each directory are for ‘.’ and ‘..’. The first is an entry for the directory itself. The second is for the parent directory. The meaning of ‘..’ is modified for the root directory of the master file system (“/”), where ‘..’ has the same meaning as ‘.’.
SEE ALSO
4.2 Berkeley Distribution — Revision 1.3 of 01/07/90